From ca9ed393ef56b963425d8d9dc101641ae7f1fd3a Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Mon, 18 Dec 2017 22:59:05 +0200 Subject: [PATCH] MDEV-13073. rpl.perf_buildin_semisync_issue40 is corrected to expect the Rpl_semi_sync_master_clients value of 1 (ll.307..). Explicit sleeps are converted to wait_xyz. --- .../r/perf_buildin_semisync_issue40.result | 14 --------- .../rpl/t/perf_buildin_semisync_issue40.test | 31 +++++++++++++------ 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/mysql-test/suite/rpl/r/perf_buildin_semisync_issue40.result b/mysql-test/suite/rpl/r/perf_buildin_semisync_issue40.result index 96b07f665d4..9607e8a7998 100644 --- a/mysql-test/suite/rpl/r/perf_buildin_semisync_issue40.result +++ b/mysql-test/suite/rpl/r/perf_buildin_semisync_issue40.result @@ -277,14 +277,7 @@ SET GLOBAL debug = 'd,rpl_semisync_simulate_create_thread_failure'; Warnings: Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead SET GLOBAL rpl_semi_sync_master_enabled= ON; -SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled'; -Variable_name Value -rpl_semi_sync_master_enabled OFF # Test failure of pthread_join -SET GLOBAL DEBUG = 'd,rpl_semisync_simulate_thread_join_failure'; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead -SET GLOBAL rpl_semi_sync_master_enabled= ON; SET GLOBAL rpl_semi_sync_master_enabled= OFF; # # Failure on registering semisync slave @@ -299,10 +292,6 @@ include/wait_for_slave_io_to_stop.inc START SLAVE IO_THREAD; include/wait_for_slave_io_to_start.inc connection con1; -# Should be Zero. -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 SET GLOBAL debug=''; Warnings: Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead @@ -325,9 +314,6 @@ connection slave; connection con1; INSERT INTO t2 values (1); connection slave; -SELECT * FROM t2; -c1 -1 connection con2; connection con1; connection slave; diff --git a/mysql-test/suite/rpl/t/perf_buildin_semisync_issue40.test b/mysql-test/suite/rpl/t/perf_buildin_semisync_issue40.test index 113e691e0af..a12730fd8c9 100644 --- a/mysql-test/suite/rpl/t/perf_buildin_semisync_issue40.test +++ b/mysql-test/suite/rpl/t/perf_buildin_semisync_issue40.test @@ -272,15 +272,18 @@ connection con1; SET GLOBAL rpl_semi_sync_master_enabled = 0; SET GLOBAL debug = 'd,rpl_semisync_simulate_create_thread_failure'; SET GLOBAL rpl_semi_sync_master_enabled= ON; ---sleep 3 -SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled'; +--let $wait_condition= SELECT @@global.rpl_semi_sync_master_enabled = 0 +--source include/wait_condition.inc + +# Todo: implement the thread join failure simulation --echo # Test failure of pthread_join -SET GLOBAL DEBUG = 'd,rpl_semisync_simulate_thread_join_failure'; -SET GLOBAL rpl_semi_sync_master_enabled= ON; ---sleep 3 +#SET GLOBAL DEBUG = 'd,rpl_semisync_simulate_thread_join_failure'; +#SET GLOBAL rpl_semi_sync_master_enabled= ON; +# +#--let $wait_condition= SELECT @@global.rpl_semi_sync_master_enabled = 0 +#--source include/wait_condition.inc SET GLOBAL rpl_semi_sync_master_enabled= OFF; ---sleep 3 --echo # --echo # Failure on registering semisync slave @@ -295,10 +298,17 @@ START SLAVE IO_THREAD; --source include/wait_for_slave_io_to_start.inc connection con1; ---echo # Should be Zero. -show status like 'Rpl_semi_sync_master_clients'; +#--echo # Should be Zero. +# Todo: implement the add_slave_failure simulation. Meanwhile +# the status will be 1. +# show status like 'Rpl_semi_sync_master_clients'; SET GLOBAL debug=''; +--let $status_var= Rpl_semi_sync_master_clients +--let $status_var_value= 1 +--let $status_type= GLOBAL +--source include/wait_for_status_var.inc + connection slave; --disable_warnings START SLAVE IO_THREAD; @@ -324,9 +334,10 @@ connection con1; #SET DEBUG_SYNC = 'before_sync_binlog_file SIGNAL before_sync_done WAIT_FOR continue'; send INSERT INTO t2 values (1); ---sleep 3 connection slave; -SELECT * FROM t2; +--let $table= t2 +--let $count= 1 +--source include/wait_until_rows_count.inc connection con2; #SET DEBUG_SYNC= "now WAIT_FOR before_sync_done";