Bug #110127 semi-sync master wait for ack when semi-sync replica is down & async replaces it
Submitted: 19 Feb 2023 11:37 Modified: 22 Feb 2023 20:20
Reporter: Yunus Shaikh Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.31 OS:Any
Assigned to: CPU Architecture:Any
Tags: MySQL, Semi-sync replication

[19 Feb 2023 11:37] Yunus Shaikh
Description:
The below scenario works fine in 8.0.29 and 8.0.30 but does not work in 8.0.31

1) Semi-sync master is replicating to one semi-sync replica and async replica
2) semi-sync replica goes down
3) rpl_semi_sync_source_timeout is set to a high value for not letting transactions go ahead without acknowledgement from at least one replica.
4) Master waits for ack from semi-sync replica but semi-sync replica is down.
5) Enable semi-sync on the async replica. Restart replica.

This should allow master to move ahead because the acknowledgement is received on the new semi-sync replica but it does not move ahead in 8.0.31.
While it works fine in older version.

How to repeat:
Step 1 - 
dbdeployer deploy replication --nodes=3 --topology=master-slave --gtid --semi-sync --read-only-slaves 8.0.31 --force --port 5800

Step 2 -
Stop node1
./node1/stop

Step 3 - 
Set Node 3 as async replica
set global rpl_semi_sync_slave_enabled = OFF;
stop replica; start replica;

Step 4 - 
connect to master and try to run some transaction after increasing timeout to large value

set global rpl_semi_sync_master_timeout = 36000000;
create database test1;

Step 5 - 
Connect to replica2 and enable semi-sync on it.
set global rpl_semi_sync_slave_enabled=ON;
stop replica;start replica;

Result - 
Master still waits when async replica is converted to semi-sync. 
Master wait for transaction with status  Waiting for semi-sync ACK from slave

Expected - 
When async replica is converted into semi-sync replica, master should start processing the transactions when rpl_semi_sync_source_wait_for_replica_count = 1. Because the semi-sync replica will acknowledge the transaction.

Expected - Master
[22 Feb 2023 20:20] MySQL Verification Team
Hi,

Thank you for the report, verified as descibed
[8 Aug 2023 17:34] Venkatesh Prasad Venugopal
This is a regression from https://github.com/mysql/mysql-server/commit/650d2f7bf275e40fd605df39ab09949aa54f5e3f

--
Venkatesh
[17 Aug 2023 15:01] Venkatesh Prasad Venugopal
Contribution patch based on 8.0.34 code to fix the issue

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: 0001-Bug-110127-semi-sync-master-wait-for-ack-when-semi-s.patch (text/x-patch), 11.21 KiB.

[17 Aug 2023 19:28] OCA Admin
Contribution submitted via Github - Bug#110127: semi-sync master wait for ack when semi-sync replica is down & async 
(*) Contribution by Venkatesh Prasad Venugopal (Github venkatesh-prasad-v, mysql-server/pull/490#issuecomment-1682441126): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_1479206153.txt (text/plain), 11.21 KiB.

[26 Jan 6:09] Venkatesh Prasad Venugopal
Hi Umesh,

Any updates on this?

--
Venkatesh Prasad (Venu)