1 ###############################################################################
2 # Description: Performs binloggable and non binloggable DDL and DML at each
3 # MySQLD in pair of clusters with (at least) 3 MySQLDs each.
4 # Then connects to each MySQLD and examines the contents of
6 # Expected contents depends on the configuration of Binlogging
8 # Default from rpl_ndb_multi_binlog_update.test is as shown
11 # Testing scenario: Cluster 1 replicates to Cluster 2
13 # Key : BL= Binlogging, LSU = LogSlaveUpdates = On
16 # cluster 1 [ srv_master srv_master1 srv_master2 ]
18 # |-----------------------
20 # cluster 2 [ srv_slave srv_slave1 srv_slave2 ]
24 # - Schema change originates on all severs in Cluster 1
25 # - MySQLD1 which is binlogging master.
26 # Identification: connection (srv_master), config (mysqld.1.1).
27 # - MySQLD2 which is not binlogging.
28 # Identification: connection (srv_master1), config (mysqld.1.2).
29 # - MySQLD3 which is binlogging but not currently master.
30 # Identification: connection (srv_master2), config (mysqld.1.3).
34 # Can act as slave, not binlogging
35 # Identification: connection (srv_slave), config (mysqld.1.slave).
37 # Can act as slave, binlogging, log-slave-updates = off
38 # Identification: connection (srv_slave1), config (mysqld.2.slave).
40 # Can act as slave, binlogging, log-slave-updates = on
41 # Identification: connection (srv_slave2), config (mysqld.3.slave).
43 # See rpl_ndb_multi_binlog_update.test for default configuration.
44 # Originally motivated by bug#45756
45 # See rpl_ndb_slave_lsu.test for full testcase
48 # - Connections srv_master, srv_master1, srv_master2, srv_slave,
49 # srv_slave1, srv_slave2 exist.
50 # - $which_slave contains the name of the slave server performing
51 # the replication slave role.
53 ###############################################################################
55 ###############################################################################
56 # Checking Replication
57 ###############################################################################
58 --echo *** Generating slave cluster originated binloggable changes ***
60 CREATE
TABLE bug_45756_slave_logged_1 (a
int) engine = NDB;
61 INSERT INTO bug_45756_slave_logged_1 VALUES (1);
62 DROP
TABLE bug_45756_slave_logged_1;
64 connection srv_slave1;
65 CREATE
TABLE bug_45756_slave_logged_2 (a
int) engine = NDB;
66 INSERT INTO bug_45756_slave_logged_2 VALUES (1);
67 DROP
TABLE bug_45756_slave_logged_2;
69 connection srv_slave2;
70 CREATE
TABLE bug_45756_slave_logged_3 (a
int) engine = NDB;
71 INSERT INTO bug_45756_slave_logged_3 VALUES (1);
72 DROP
TABLE bug_45756_slave_logged_3;
74 --echo ***Generating slave cluster non-binloggable changes***
77 CREATE
TABLE bug_45756_slave_not_logged_1 (a
int) engine = NDB;
78 INSERT INTO bug_45756_slave_not_logged_1 VALUES (1);
79 DROP
TABLE bug_45756_slave_not_logged_1;
82 connection srv_slave1;
84 CREATE
TABLE bug_45756_slave_not_logged_2 (a
int) engine = NDB;
85 INSERT INTO bug_45756_slave_not_logged_2 VALUES (1);
86 DROP
TABLE bug_45756_slave_not_logged_2;
89 connection srv_slave2;
91 CREATE
TABLE bug_45756_slave_not_logged_3 (a
int) engine = NDB;
92 INSERT INTO bug_45756_slave_not_logged_3 VALUES (1);
93 DROP
TABLE bug_45756_slave_not_logged_3;
96 --echo *** Generating data
to be replicated ***
97 connection srv_master;
98 CREATE
TABLE bug45756_master_logged_1 (a
int) engine = NDB;
99 INSERT INTO bug45756_master_logged_1 VALUES (1);
100 DROP
TABLE bug45756_master_logged_1;
102 connection srv_master1;
103 CREATE
TABLE bug45756_master_logged_2 (a
int) engine = NDB;
104 INSERT INTO bug45756_master_logged_2 VALUES (1);
105 DROP
TABLE bug45756_master_logged_2;
107 connection srv_master2;
108 CREATE
TABLE bug45756_master_logged_3 (a
int) engine = NDB;
109 INSERT INTO bug45756_master_logged_3 VALUES (1);
110 DROP
TABLE bug45756_master_logged_3;
112 --echo *** Generating changes not
to be replicated ***
113 connection srv_master;
115 CREATE
TABLE bug45756_master_not_logged_1 (a
int) engine = NDB;
116 INSERT INTO bug45756_master_not_logged_1 VALUES (1);
117 DROP
TABLE bug45756_master_not_logged_1;
120 connection srv_master1;
122 CREATE
TABLE bug45756_master_not_logged_2 (a
int) engine = NDB;
123 INSERT INTO bug45756_master_not_logged_2 VALUES (1);
124 DROP
TABLE bug45756_master_not_logged_2;
127 connection srv_master2;
129 CREATE
TABLE bug45756_master_not_logged_3 (a
int) engine = NDB;
130 INSERT INTO bug45756_master_not_logged_3 VALUES (1);
131 DROP
TABLE bug45756_master_not_logged_3;
134 connection srv_master;
135 sync_slave_with_master $which_slave;
137 --echo *** Checking binlog contents on every server in
both clusters ***
138 connection srv_master;
142 --echo connection srv_master;
143 show variables like
'server_id';
144 show variables like
'log_bin';
145 show variables like
'log_slave_updates';
146 --source include/show_binlog_events2.inc
147 let $BINLOG_FILENAME=master-bin;
148 --source suite/ndb_rpl/t/ndb_rpl_get_binlog_events.inc
151 connection srv_master1;
155 --echo connection srv_master1;
156 show variables like
'server_id';
157 show variables like
'log_bin';
158 show variables like
'log_slave_updates';
159 --source include/show_binlog_events2.inc
161 connection srv_master2;
165 --echo connection srv_master2;
166 show variables like
'server_id';
167 show variables like
'log_bin';
168 show variables like
'log_slave_updates';
169 --source include/show_binlog_events2.inc
170 let $BINLOG_FILENAME=master-bin;
171 --source suite/ndb_rpl/t/ndb_rpl_get_binlog_events.inc
173 connection srv_slave;
177 --echo connection srv_slave;
178 show variables like
'server_id';
179 show variables like
'log_bin';
180 show variables like
'log_slave_updates';
181 --source include/show_binlog_events2.inc
183 connection srv_slave1;
187 --echo connection srv_slave1;
188 show variables like
'server_id';
189 show variables like
'log_bin';
190 show variables like
'log_slave_updates';
191 --source include/show_binlog_events2.inc
192 let $BINLOG_FILENAME=slave-master-bin;
193 --source suite/ndb_rpl/t/ndb_rpl_get_binlog_events.inc
195 connection srv_slave2;
199 --echo connection srv_slave2;
200 show variables like
'server_id';
201 show variables like
'log_bin';
202 show variables like
'log_slave_updates';
203 --source include/show_binlog_events2.inc
204 let $BINLOG_FILENAME=slave-master-bin;
205 --source suite/ndb_rpl/t/ndb_rpl_get_binlog_events.inc
207 connection $which_slave;