Bug #62174 A feature for semi-sync replication
Submitted: 16 Aug 2011 2:37 Modified: 8 Jul 2013 11:57
Reporter: zhou zhenxing (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version: OS:Any
Assigned to:
Tags: Contribution, replication, semi-sync
Triage: Needs Triage: D5 (Feature request)

[16 Aug 2011 2:37] zhou zhenxing
Description:
Semi-sync is cool. But in the semi-sync solution, there are “phantom read”: When InnoDB commit a transaction and no slave have accept the binary log, at the time another “new thread” still can read the data generated by this transaction. If database crash and gone(can't startup anymore) at this right time, although we have ever read these data, it's not exist in any slave and we think this transaction is never happened.

In our application architecture, if our “new thread” read “phantom data”, we will try to do some work about user's critical information. So we must not read the “phantom data”.

So,we add a new variables for semi-sync "rpl_semi_sync_master_wait_before_commit".Once you set this variables ON, MySQL(InnoDB) will not commit the transaction until at least one slave get the binary log. By default, it is OFF and semi-sync act as the original way.

How to repeat:
The "phantom read" the nature of original semi-sync.

Suggested fix:
A patch has been commit on Launchpad.net:
https://code.launchpad.net/~orczhou/mysql-server/ESR
[14 Nov 2011 18:27] Valerii Kravchuk
Thank you for the feature request and patch contributed.
[17 Jan 2013 2:44] zhou zhenxing
Enhanced Semi-sync Replication to make sure log sent before *commit*

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

Contribution: ESR.MySQL.5.5.16.patch (application/octet-stream, text), 19.36 KiB.

[17 Jan 2013 3:10] zhou zhenxing
MySQL5.5.15 Enhanced Semi-sync Replication to make sure log sent before *commit*

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

Contribution: ESR.percona.5.5.15.patch (application/octet-stream, text), 20.03 KiB.

[17 Jan 2013 3:11] zhou zhenxing
Bug fix bug#44058(issue 5)

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

Contribution: ESR.percona.5.5.15.fix-bug-44058.patch (application/octet-stream, text), 6.43 KiB.

[8 Jul 2013 11:55] Ståle Deraas
Hi Zhou Zhenxing,

Thank you again for the contributions. Your contributions have not been used, but we wrote a new patch inspired by them.