| 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 |
# Add suppression for the LOST_EVENTS error message |
| 26 |
# which will occur on slave when master is restarted while |
| 27 |
# slave is running |
| 28 |
--disable_query_log |
| 29 |
call mtr.add_suppression("Replica.*: The incident LOST_EVENTS occurred on the source"); |
| 30 |
--enable_query_log |
| 31 |
|
| 32 |
--connection master |
| 33 |
|
| 34 |
--echo Restarting mysqld |
| 35 |
# Hack to allow using restart_mysqld.inc from rpl test |
| 36 |
let $allow_rpl_inited=1; |
| 37 |
|
| 38 |
# Ignore the warning generated by ndbcluster's binlog thread |
| 39 |
# when mysqld is restarted |
| 40 |
--disable_query_log ONCE |
| 41 |
call mtr.add_suppression("mysqld startup An incident event has been written"); |
| 42 |
|
| 43 |
let $mysqld_name=mysqld.1.1; |
| 44 |
--source include/restart_mysqld.inc |
| 45 |
|
| 46 |
# Reconnect all clients configured by rpl_init |
| 47 |
--let $rpl_server_number= 1 |
| 48 |
--source include/rpl_reconnect.inc |
| 49 |
|
| 50 |
# When mysqld starts up again it will: |
| 51 |
# - rotate the binary log(thus switching to second log) |
| 52 |
# - ndbcluster binlog injector will write the special incident |
| 53 |
# event telling that it might not have injected all NDB changes |
| 54 |
# i.e LOST_EVENTS, this also causes the binlog to be rotated |
| 55 |
# again(thus switching to third log) |
| 56 |
# |
| 57 |
# Show that the second log contains the LOST_EVENT incident |
| 58 |
# and that the binlog has been rotated(ie. flush, rotate and purge). |
| 59 |
let $binlog_file=master-bin.000002; |
| 60 |
--source include/show_binlog_events.inc |
| 61 |
|
| 62 |
drop table if exists t1; |
| 63 |
|
| 64 |
--echo Get IO thread to reconnect to Master |
| 65 |
--connection slave |
| 66 |
--disable_result_log |
| 67 |
start slave; |
| 68 |
--enable_result_log |
| 69 |
|
| 70 |
let $slave_sql_errno= 13119; # ER_REPLICA_INCIDENT |
| 71 |
let $show_slave_sql_error=1; |
| 72 |
-- source include/wait_for_slave_sql_error.inc |
| 73 |
|
| 74 |
let $status_items= Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_Error; |
| 75 |
-- source include/show_slave_status.inc |
| 76 |
|
| 77 |
# Cleanup |
| 78 |
drop table if exists t1; |
| 79 |
|
| 80 |
--source include/stop_slave_io.inc |
| 81 |
RESET SLAVE; |
| 82 |
--let $rpl_only_running_threads= 1 |
| 83 |
--source include/rpl_end.inc |