revision-id: 7ab258ec112ebfb389e1fd0bb6a8ff44c0fb6eca (mariadb-10.1.39-71-g7ab258ec112) parent(s): 7f2cfa8f47cf05d8dbea65ced3656fd0fc6efbf5 author: Sujatha committer: Sujatha timestamp: 2019-06-28 21:50:56 +0530 message: MDEV-19370: rpl.kill_race_condition failed in buildbot with Wrong value for slave parameter Problem: ======= Executing test with following options will result in test failure. ./mtr rpl.kill_race_condition{,,,,,,,,,,} --repeat=10 --par 12 --mem Fix: ==== Test simulates applier thread kill scenario while applying a row event. But it doesn't wait for applier to catch the error stop. Added :wait_for_slave_sql_error.inc to catch the error. Test uses START SLAVE as a final step and doesn't wait for both threads to start. Added: start_slave.inc --- mysql-test/suite/rpl/r/kill_race_condition.result | 9 ++++++--- mysql-test/suite/rpl/t/kill_race_condition.test | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/mysql-test/suite/rpl/r/kill_race_condition.result b/mysql-test/suite/rpl/r/kill_race_condition.result index e4e347dc786..48fd65e3a7c 100644 --- a/mysql-test/suite/rpl/r/kill_race_condition.result +++ b/mysql-test/suite/rpl/r/kill_race_condition.result @@ -1,13 +1,16 @@ include/master-slave.inc [connection master] -set global debug_dbug='d,rows_log_event_before_open_table'; -set debug_sync='now WAIT_FOR before_open_table'; create table t1 (a int); +set global debug_dbug='d,rows_log_event_before_open_table'; insert t1 values (1),(2),(3); +set debug_sync='now WAIT_FOR before_open_table'; kill slave_sql_thread; set debug_sync='now SIGNAL go_ahead_sql'; +include/wait_for_slave_sql_error.inc [errno=1927] +Last_SQL_Error = Error executing row event: 'Connection was killed' set global debug_dbug=''; set debug_sync='RESET'; drop table t1; -start slave; +include/start_slave.inc +Last_SQL_Error = include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/kill_race_condition.test b/mysql-test/suite/rpl/t/kill_race_condition.test index 4268c12cdbf..0f3b44864fe 100644 --- a/mysql-test/suite/rpl/t/kill_race_condition.test +++ b/mysql-test/suite/rpl/t/kill_race_condition.test @@ -2,27 +2,34 @@ source include/have_debug_sync.inc; source include/have_binlog_format_row.inc; source include/master-slave.inc; +connection master; +create table t1 (a int); +--sync_slave_with_master + connection slave; set global debug_dbug='d,rows_log_event_before_open_table'; -send set debug_sync='now WAIT_FOR before_open_table'; connection master; -create table t1 (a int); insert t1 values (1),(2),(3); connection slave; -reap; +set debug_sync='now WAIT_FOR before_open_table'; let $a=`select id from information_schema.processlist where state='debug sync point: now'`; replace_result $a slave_sql_thread; eval kill $a; set debug_sync='now SIGNAL go_ahead_sql'; +--let $slave_sql_errno= 1927 +--source include/wait_for_slave_sql_error.inc +let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); +--echo Last_SQL_Error = $error set global debug_dbug=''; set debug_sync='RESET'; - connection master; drop table t1; connection slave; -start slave; +--source include/start_slave.inc +let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); +--echo Last_SQL_Error = $error source include/rpl_end.inc;