diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-12-23 19:28:02 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-12-23 19:28:02 +0100 |
commit | 25561435e0b1fe42ec29d5ab06dc15875cdd1cfa (patch) | |
tree | d2e67d4509577d84da7ade2820154c904180e151 /mysql-test/suite/rpl | |
parent | fa1aef39ebc7d84d24d4e3d2124f982526632ee9 (diff) | |
parent | 8d8370e31d48e0bc6139c18770746f9959c21598 (diff) | |
download | mariadb-git-25561435e0b1fe42ec29d5ab06dc15875cdd1cfa.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'mysql-test/suite/rpl')
-rw-r--r-- | mysql-test/suite/rpl/include/rpl_semi_sync.inc | 72 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_semi_sync.result | 19 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result | 19 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result | 19 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_parallel_retry.test | 3 |
5 files changed, 38 insertions, 94 deletions
diff --git a/mysql-test/suite/rpl/include/rpl_semi_sync.inc b/mysql-test/suite/rpl/include/rpl_semi_sync.inc index 393b49372e1..c3cd918b5fc 100644 --- a/mysql-test/suite/rpl/include/rpl_semi_sync.inc +++ b/mysql-test/suite/rpl/include/rpl_semi_sync.inc @@ -9,7 +9,6 @@ source include/have_innodb.inc; source include/master-slave.inc; let $engine_type= InnoDB; -#let $engine_type= MyISAM; # Suppress warnings that might be generated during the test connection master; @@ -94,7 +93,6 @@ enable_query_log; echo [ status of semi-sync on master should be OFF ]; show status like 'Rpl_semi_sync_master_clients'; show status like 'Rpl_semi_sync_master_status'; ---replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; # reset master to make sure the following test will start with a clean environment @@ -201,16 +199,23 @@ connection slave; source include/stop_slave.inc; connection master; +--source include/kill_binlog_dump_threads.inc set global rpl_semi_sync_master_timeout= 5000; # The first semi-sync check should be on because after slave stop, # there are no transactions on the master. echo [ master status should be ON ]; -show status like 'Rpl_semi_sync_master_status'; + +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; + +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 0; +source include/wait_for_status_var.inc; + show status like 'Rpl_semi_sync_master_no_tx'; ---replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; -show status like 'Rpl_semi_sync_master_clients'; echo [ semi-sync replication of these transactions will fail ]; insert into t1 values (500); @@ -225,7 +230,6 @@ source include/wait_for_status_var.inc; echo [ master status should be OFF ]; show status like 'Rpl_semi_sync_master_status'; show status like 'Rpl_semi_sync_master_no_tx'; ---replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; # Semi-sync status on master is now OFF, so all these transactions @@ -246,7 +250,6 @@ insert into t1 values (100); echo [ master status should be OFF ]; show status like 'Rpl_semi_sync_master_status'; show status like 'Rpl_semi_sync_master_no_tx'; ---replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; --echo # @@ -274,9 +277,11 @@ connection master; # The master semi-sync status should be on again after slave catches up. echo [ master status should be ON again after slave catches up ]; -show status like 'Rpl_semi_sync_master_status'; + +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; show status like 'Rpl_semi_sync_master_no_tx'; ---replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; show status like 'Rpl_semi_sync_master_clients'; @@ -332,11 +337,7 @@ replace_result $engine_type ENGINE_TYPE; eval create table t1 (a int) engine = $engine_type; drop table t1; -##show status like 'Rpl_semi_sync_master_status'; - sync_slave_with_master; ---replace_column 2 # -show status like 'Rpl_relay%'; echo [ test reset master ]; connection master; @@ -353,19 +354,7 @@ source include/stop_slave.inc; reset slave; # Kill the dump thread on master for previous slave connection and -# wait for it to exit -connection master; -let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`; -if ($_tid) -{ - --replace_result $_tid _tid - eval kill query $_tid; - - # After dump thread exit, Rpl_semi_sync_master_clients will be 0 - let $status_var= Rpl_semi_sync_master_clients; - let $status_var_value= 0; - source include/wait_for_status_var.inc; -} +--source include/kill_binlog_dump_threads.inc connection slave; source include/start_slave.inc; @@ -404,17 +393,7 @@ connection master; reset master; # Kill the dump thread on master for previous slave connection and wait for it to exit -let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`; -if ($_tid) -{ - --replace_result $_tid _tid - eval kill query $_tid; - - # After dump thread exit, Rpl_semi_sync_master_clients will be 0 - let $status_var= Rpl_semi_sync_master_clients; - let $status_var_value= 0; - source include/wait_for_status_var.inc; -} +--source include/kill_binlog_dump_threads.inc # Do not binlog the following statement because it will generate # different events for ROW and STATEMENT format @@ -459,21 +438,16 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; connection master; # Kill the dump thread on master for previous slave connection and wait for it to exit -let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`; -if ($_tid) -{ - --replace_result $_tid _tid - eval kill query $_tid; - - # After dump thread exit, Rpl_semi_sync_master_clients will be 0 - let $status_var= Rpl_semi_sync_master_clients; - let $status_var_value= 0; - source include/wait_for_status_var.inc; -} +--source include/kill_binlog_dump_threads.inc echo [ Semi-sync status on master should be ON ]; -show status like 'Rpl_semi_sync_master_clients'; +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 0; +source include/wait_for_status_var.inc; show status like 'Rpl_semi_sync_master_status'; +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; set global rpl_semi_sync_master_enabled= 0; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result index 106efb555d3..d18bd1efda7 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result @@ -164,20 +164,15 @@ connection slave; connection slave; include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc set global rpl_semi_sync_master_timeout= 5000; [ master status should be ON ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 0 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 14 -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 [ semi-sync replication of these transactions will fail ] insert into t1 values (500); [ master status should be OFF ] @@ -235,9 +230,6 @@ max(a) 500 connection master; [ master status should be ON again after slave catches up ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 12 @@ -304,8 +296,6 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; -show status like 'Rpl_relay%'; -Variable_name Value [ test reset master ] connection master; reset master; @@ -321,7 +311,7 @@ Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc reset slave; -connection master; +include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc connection master; @@ -353,6 +343,7 @@ include/stop_slave.inc reset slave; connection master; reset master; +include/kill_binlog_dump_threads.inc set sql_log_bin=0; grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; flush privileges; @@ -403,10 +394,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status OFF connection master; +include/kill_binlog_dump_threads.inc [ Semi-sync status on master should be ON ] -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 show status like 'Rpl_semi_sync_master_status'; Variable_name Value Rpl_semi_sync_master_status ON diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result index c61340f3967..f2240817489 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result @@ -165,20 +165,15 @@ connection slave; connection slave; include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc set global rpl_semi_sync_master_timeout= 5000; [ master status should be ON ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 0 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 16 -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 [ semi-sync replication of these transactions will fail ] insert into t1 values (500); [ master status should be OFF ] @@ -236,9 +231,6 @@ max(a) 500 connection master; [ master status should be ON again after slave catches up ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 12 @@ -305,8 +297,6 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; -show status like 'Rpl_relay%'; -Variable_name Value [ test reset master ] connection master; reset master; @@ -322,7 +312,7 @@ Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc reset slave; -connection master; +include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc connection master; @@ -354,6 +344,7 @@ include/stop_slave.inc reset slave; connection master; reset master; +include/kill_binlog_dump_threads.inc set sql_log_bin=0; grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; flush privileges; @@ -404,10 +395,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status OFF connection master; +include/kill_binlog_dump_threads.inc [ Semi-sync status on master should be ON ] -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 show status like 'Rpl_semi_sync_master_status'; Variable_name Value Rpl_semi_sync_master_status ON diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result index 6a23f24b66d..fcced801d65 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result @@ -165,20 +165,15 @@ connection slave; connection slave; include/stop_slave.inc connection master; +include/kill_binlog_dump_threads.inc set global rpl_semi_sync_master_timeout= 5000; [ master status should be ON ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 0 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 14 -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 [ semi-sync replication of these transactions will fail ] insert into t1 values (500); [ master status should be OFF ] @@ -236,9 +231,6 @@ max(a) 500 connection master; [ master status should be ON again after slave catches up ] -show status like 'Rpl_semi_sync_master_status'; -Variable_name Value -Rpl_semi_sync_master_status ON show status like 'Rpl_semi_sync_master_no_tx'; Variable_name Value Rpl_semi_sync_master_no_tx 12 @@ -305,8 +297,6 @@ connection master; create table t1 (a int) engine = ENGINE_TYPE; drop table t1; connection slave; -show status like 'Rpl_relay%'; -Variable_name Value [ test reset master ] connection master; reset master; @@ -322,7 +312,7 @@ Rpl_semi_sync_master_yes_tx 0 connection slave; include/stop_slave.inc reset slave; -connection master; +include/kill_binlog_dump_threads.inc connection slave; include/start_slave.inc connection master; @@ -354,6 +344,7 @@ include/stop_slave.inc reset slave; connection master; reset master; +include/kill_binlog_dump_threads.inc set sql_log_bin=0; grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; flush privileges; @@ -404,10 +395,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status OFF connection master; +include/kill_binlog_dump_threads.inc [ Semi-sync status on master should be ON ] -show status like 'Rpl_semi_sync_master_clients'; -Variable_name Value -Rpl_semi_sync_master_clients 0 show status like 'Rpl_semi_sync_master_status'; Variable_name Value Rpl_semi_sync_master_status ON diff --git a/mysql-test/suite/rpl/t/rpl_parallel_retry.test b/mysql-test/suite/rpl/t/rpl_parallel_retry.test index 96863f9021d..0140784c8b9 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_retry.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_retry.test @@ -436,6 +436,9 @@ SET @@DEBUG_SYNC='now SIGNAL proceed_by_1000'; --connection spoiler_21 ROLLBACK; +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE '%debug sync point%'; +--source include/wait_condition.inc + --echo # Release the 2nd worker to proceed --connection spoiler_22 ROLLBACK; |