1 # suite/t/rpl_ndb/wait_schema_logging.inc
4 # Waits until schema op performed on $source_server is
5 # being logged by $dest_server
6 # Assumes that source_server and dest_server are connected
8 # Assumes that $dest_server has binlogging enabled.
10 ###############################################################
11 # Include file to wait for schema logging setup, where schema
12 # changes made on $source_server are logged on $dest_server
13 ###############################################################
15 connection $dest_server;
17 #--echo Waiting for schema event logging to be active between $source_server and $dest_server
18 #--echo - First check that $dest_server has binary logging enabled
20 let $binlog= query_get_value(show variables like
'log_bin', Value, 1);
21 if (`SELECT
"$binlog" !=
"ON"`)
23 show variables like
'server_id';
24 show variables like
'log_bin';
25 --die ERROR: Binlogging not activated
32 # Following code 'inspired' by include/wait_for_binlog_event.inc
34 --let $wait_binlog_event=drop
table
40 while (`SELECT INSTR(
"$_event",
"$wait_binlog_event") = 0`)
42 #--echo loop_count is $_loop_count;
47 --die ERROR: failed
while waiting local cluster schema
event logging
to start
50 connection $source_server;
52 create
table wait_schema_logging (a
int primary key) engine=ndb;
53 drop
table wait_schema_logging;
55 connection $dest_server;
57 let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
58 #--echo Event is : $_event
59 while (`SELECT (
"$_event" !=
"No such row") and (INSTR(
"$_event",
"$wait_binlog_event") = 0)`)
62 let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
63 #--echo Event did not match- next event is $_event;
67 # Since we're attached to the same cluster, if we've seen the event
68 # then synchronous binlogging of changes is on (i.e. synchronous with
69 # the original schema change)
70 # Therefore it should now be safe to reset the master on the destination
71 # server as no more binlog changes are in-flight.
72 connection $dest_server;
78 #--echo - Schema event logging is active