summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorHe Zhenxing <zhenxing.he@sun.com>2009-10-12 21:15:32 +0800
committerHe Zhenxing <zhenxing.he@sun.com>2009-10-12 21:15:32 +0800
commit1a7c7a4066c99e24adfc7d4e11d84fe21dec1959 (patch)
treea2150617b4f510fe038d64c8408831fd2187a538 /mysql-test
parent26b47d9347449ffba9dcc0a36aee91379f12e604 (diff)
downloadmariadb-git-1a7c7a4066c99e24adfc7d4e11d84fe21dec1959.tar.gz
Backport BUG#47298 Semisync: always wait until timeout if no semi-sync slave available
Add an option to control whether the master should keep waiting until timeout when it detected that there is no semi-sync slave available. The bool option 'rpl_semi_sync_master_wait_no_slave' is 1 by defalt, and will keep waiting until timeout. When set to 0, the master will switch to asynchronous replication immediately when no semi-sync slave is available.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync.result14
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync.test7
2 files changed, 12 insertions, 9 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result
index 6e57086a639..607b77fbd04 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result
@@ -29,13 +29,13 @@ set global rpl_semi_sync_master_enabled = 1;
show variables like 'rpl_semi_sync_master_enabled';
Variable_name Value
rpl_semi_sync_master_enabled ON
-[ status of semi-sync on master should be OFF without any semi-sync slaves ]
+[ status of semi-sync on master should be ON even without any semi-sync slaves ]
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 OFF
+Rpl_semi_sync_master_status ON
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
@@ -210,7 +210,7 @@ include/stop_slave.inc
[ Semi-sync master status variables before FLUSH STATUS ]
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
Variable_name Value
-Rpl_semi_sync_master_no_tx 3
+Rpl_semi_sync_master_no_tx 302
SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 302
@@ -355,7 +355,7 @@ 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 OFF
+Rpl_semi_sync_master_status ON
set global rpl_semi_sync_master_enabled= 0;
[ on slave ]
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
@@ -364,17 +364,17 @@ rpl_semi_sync_slave_enabled ON
include/start_slave.inc
[ on master ]
insert into t1 values (8);
-[ master semi-sync clients should be 0, status should be OFF ]
+[ master semi-sync clients should be 1, status should be OFF ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
-Rpl_semi_sync_master_clients 0
+Rpl_semi_sync_master_clients 1
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
Rpl_semi_sync_master_status OFF
[ on slave ]
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
-Rpl_semi_sync_slave_status OFF
+Rpl_semi_sync_slave_status ON
include/stop_slave.inc
[ on master ]
set sql_log_bin=0;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
index 52e6a309b12..8f1d4ccaa42 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -74,7 +74,7 @@ echo [ enable semi-sync on master ];
set global rpl_semi_sync_master_enabled = 1;
show variables like 'rpl_semi_sync_master_enabled';
-echo [ status of semi-sync on master should be OFF without any semi-sync slaves ];
+echo [ status of semi-sync on master should be ON even without any semi-sync slaves ];
show status like 'Rpl_semi_sync_master_clients';
show status like 'Rpl_semi_sync_master_status';
show status like 'Rpl_semi_sync_master_yes_tx';
@@ -497,7 +497,10 @@ source include/start_slave.inc;
connection master;
echo [ on master ];
insert into t1 values (8);
-echo [ master semi-sync clients should be 0, status should be OFF ];
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+echo [ master semi-sync clients should be 1, status should be OFF ];
show status like 'Rpl_semi_sync_master_clients';
show status like 'Rpl_semi_sync_master_status';
sync_slave_with_master;