Bug #60425 The rpl_semi_sync_master_wait_no_slave variable is invalid
Submitted: 11 Mar 2011 2:58 Modified: 19 Jan 2012 18:46
Reporter: bao peng Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:mysql5.5 OS:Any
Assigned to: CPU Architecture:Any

[11 Mar 2011 2:58] bao peng
Description:
Example. I have test. If a replication broken,all of slaves was broken. On master insert a row,will wait for rpl_semi_sync_master_timeout=10000 (microsecond). if set rpl_semi_sync_master_wait_no_slave=1,insert a row need  wait for 10s.if set rpl_semi_sync_master_wait_no_slave=0,a insert still wait for 10s. The variable rpl_semi_sync_master_wait_no_slave= is invalid. I understanding when this variable 
is OFF,all slaves was broken, on master insert a new row,the master won't wait timeout set.In fact,when this variable is OFF,the master still wait timeout set.
The variable is invalid.set rpl_semi_sync_master_wait_no_slave On or OFF has no change.

How to repeat:
always

Suggested fix:
fix it .
[22 Mar 2011 0:44] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Please provide exact statement you use to set this variable. Do you use GLOBAL keyword?
[24 Mar 2011 9:04] bao peng
Mysql version:
Server version:		5.5.9-log Source distribution
Protocol version:	10
Connection:		mysql-ha-node1 via TCP/IP

Comment: (my test) two machines
master hostname:mysql-ha-node1                            
slave hostname:mysql-ha-node2
1. variables
[mysql-ha-node1]>show variables like '%semi%';
+------------------------------------+-------+
| Variable_name                      | Value |
+------------------------------------+-------+
| rpl_semi_sync_master_enabled       | ON    |--master
| rpl_semi_sync_master_timeout       | 10000 |-- 10s
| rpl_semi_sync_master_trace_level   | 32    |
| rpl_semi_sync_master_wait_no_slave | OFF   |
| rpl_semi_sync_slave_enabled        | OFF   |
| rpl_semi_sync_slave_trace_level    | 32    |
+------------------------------------+-------+
[mysql-ha-node2]>show global variables like '%semi%';
+------------------------------------+-------+
| Variable_name                      | Value |
+------------------------------------+-------+
| rpl_semi_sync_master_enabled       | OFF   |
| rpl_semi_sync_master_timeout       | 10000 |
| rpl_semi_sync_master_trace_level   | 32    |
| rpl_semi_sync_master_wait_no_slave | OFF   |
| rpl_semi_sync_slave_enabled        | ON    |--SLave
| rpl_semi_sync_slave_trace_level    | 32    |
+------------------------------------+-------

2.On slave host ,make slave failed scenario
stop slave io_thread; (if replication failure,at this time has no slave)
[mysql-ha-node2]>show global status like '%semi%';
| Rpl_semi_sync_slave_status                 | OFF   |
3.On master host,
[mysql-ha-node1]>show global status like '%semi%'; (at same time)
| Rpl_semi_sync_master_status                | ON    |
[mysql-ha-node1]>insert into user1 set u='baopeng',c='good man';
Query OK, 1 row affected (10.01 sec) 
I think if the slave has failed,the semireplication has broken. at this time,the new statement not need to wait the rpl_semi_sync_master_timeout=10000 set. automatic from semi change to normal replication. maybe I think was wrong.
thx regard
[19 Jan 2012 18:46] Sveta Smirnova
Thank you for the feedback.

This is not a bug: master does not know if slave failed or not. Only way to know it is wait answer from slave IO thread.

If you need truly synchronous replication you can try MySQL Cluster, just study its limitations and how it can affect your application first.