| 1 |
--source include/have_ndb.inc |
| 2 |
--source include/have_binlog_format_mixed_or_row.inc |
| 3 |
--source suite/ndb_rpl/ndb_master-slave.inc |
| 4 |
|
| 5 |
--connection master |
| 6 |
create table t1(pk int not null primary key, i int) engine = ndb; |
| 7 |
|
| 8 |
# |
| 9 |
# insert more records into tables |
| 10 |
# |
| 11 |
let $1=1000; |
| 12 |
disable_query_log; |
| 13 |
while ($1) |
| 14 |
{ |
| 15 |
eval insert into t1 values($1, $1); |
| 16 |
dec $1; |
| 17 |
} |
| 18 |
enable_query_log; |
| 19 |
|
| 20 |
--sync_slave_with_master |
| 21 |
# connect to slave and ensure data is there. |
| 22 |
--connection slave |
| 23 |
select count(*) from t1; |
| 24 |
|
| 25 |
--connection master |
| 26 |
|
| 27 |
--echo Restarting mysqld |
| 28 |
# Hack to allow using restart_mysqld.inc from rpl test |
| 29 |
let $allow_rpl_inited=1; |
| 30 |
|
| 31 |
# Ignore the warning generated by ndbcluster's binlog thread |
| 32 |
# when mysqld is restarted |
| 33 |
--disable_query_log ONCE |
| 34 |
call mtr.add_suppression("mysqld startup An incident event has been written"); |
| 35 |
|
| 36 |
let $mysqld_name=mysqld.1.1; |
| 37 |
--source include/restart_mysqld.inc |
| 38 |
|
| 39 |
# Reconnect all clients configured by rpl_init |
| 40 |
--let $rpl_server_number= 1 |
| 41 |
--source include/rpl_reconnect.inc |
| 42 |
|
| 43 |
# When mysqld starts up again it will: |
| 44 |
# - rotate the binary log(thus switching to second log) |
| 45 |
# - ndbcluster binlog injector will write the special incident |
| 46 |
# event telling that it might not have injected all NDB changes |
| 47 |
# i.e LOST_EVENTS, this also causes the binlog to be rotated |
| 48 |
# again(thus switching to third log) |
| 49 |
# |
| 50 |
# Show that the second log contains the LOST_EVENT incident |
| 51 |
# and that the binlog has been rotated(ie. flush, rotate and purge). |
| 52 |
let $binlog_file=master-bin.000002; |
| 53 |
--source include/show_binlog_events.inc |
| 54 |
|
| 55 |
--disable_result_log |
| 56 |
--connection slave |
| 57 |
# Get slave to try reconnection now. Ignore errors if already started. |
| 58 |
start slave; |
| 59 |
--connection master |
| 60 |
--enable_result_log |
| 61 |
|
| 62 |
--echo Sync Slave with master |
| 63 |
--sync_slave_with_master |
| 64 |
|
| 65 |
--connection slave |
| 66 |
|
| 67 |
--echo Show that Slave has not stopped (has skipped GAP) |
| 68 |
|
| 69 |
let $status_items= Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_Error; |
| 70 |
-- source include/show_slave_status.inc |
| 71 |
|
| 72 |
--echo Show that replication can continue |
| 73 |
--connection master |
| 74 |
insert into t1 values (1001, 1001); |
| 75 |
|
| 76 |
--sync_slave_with_master |
| 77 |
|
| 78 |
--connection slave |
| 79 |
|
| 80 |
select count(*) from t1; |
| 81 |
|
| 82 |
--connection master |
| 83 |
drop table t1; |
| 84 |
|
| 85 |
# Cleanup Replication |
| 86 |
--source include/rpl_end.inc |