Bug #70410 DDL queries increases rpl_semi_sync_master_yes_tx by a value of 2
Submitted: 24 Sep 2013 18:49 Modified: 27 Nov 2013 17:03
Reporter: Santosh Praneeth Banda Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:mysql 5.6.13, 5.6.14 OS:Any
Assigned to: CPU Architecture:Any

[24 Sep 2013 18:49] Santosh Praneeth Banda
Description:
see how to repeat

How to repeat:
1) Install semisync master and slave plugin on both master and slave
2) use test; create table t1 (a int);
3) check out the output of show status like 'rpl_semi_sync_master_yes_tx'; rpl_semi_sync_master_yes_tx increased by 2

Suggested fix:
It seems semisync master plugin is called twice in case of DDL queries
[25 Sep 2013 13:08] Umesh Shastry
Hello Santosh,

Thank you for the bug report and test case.
Verified as described.

Thanks,
Umesh
[27 Nov 2013 17:03] Jon Stephens
Fixed in 5.6+. Noted as follows in the 5.6.16 and 5.7.4 changelogs:

        The semisynchronous replication plugin was called twice for a
        DDL statement, incrementing rpl_semi_sync_master_yes_tx by 2
        instead of 1 each time such a statement was executed.

Closed.
[3 Feb 2014 10:44] Laurynas Biveinis
5.6$ bzr log -r 5652
------------------------------------------------------------
revno: 5652
committer: Luis Soares <luis.soares@oracle.com>
branch nick: mysql-5.6
timestamp: Wed 2013-11-27 09:19:19 +0000
message:
  BUG#17509011: DDL QUERIES INCREASES RPL_SEMI_SYNC_MASTER_YES_TX 
  BY A VALUE OF 2
  
  The problem is that the after_commit hook is being called twice during
  the DDL execution: first on the COMMIT stage of the binlog group
  commit procedure (MYSQL_BIN_LOG::process_after_commit_stage_queue) and
  a second time during the transaction implicit commit
  (trans_commit_implicit). And this happens even though the first time
  the hook is called, the flag transaction->run_hooks is set to false.
  
  The smallest and quickest fix for this issue is to deploy checks when
  we call the after_commit hook, to verify that we have not called the
  hook already during this "transaction" lifecycle.