Bug #70414 redundant code in ReplSemiSyncMaster::updateSyncHeader
Submitted: 25 Sep 2013 9:31 Modified: 21 Oct 2013 16:06
Reporter: zhai weixiang (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.6,5.7 OS:Any
Assigned to: CPU Architecture:Any

[25 Sep 2013 9:31] zhai weixiang
Description:
In function ReplSemiSyncMaster::updateSyncHeader

Since the default value of sync is false,   needed set sync to false twice.

quoted code :

  bool sync = false;

  /* If the semi-sync master is not enabled, or the slave is not a semi-sync
   * target, do not request replies from the slave.
   */
  if (!getMasterEnabled() || !is_semi_sync_slave())
  {
    sync = false;
    return 0;
  }

  function_enter(kWho);

  lock();

  /* This is the real check inside the mutex. */
  if (!getMasterEnabled())
  {
    sync = false;
    goto l_end;
  }

  if (is_on())
  {
    /* semi-sync is ON */
    sync = false;

How to repeat:
read the code 

Suggested fix:
remove the redundant code.
[25 Sep 2013 9:32] zhai weixiang
needed set sync to false twice
 ---> needn't set sync to false twice
[25 Sep 2013 11:08] MySQL Verification Team
Hello Zhai,

Thank you for the bug report.

Thanks,
Umesh
[21 Oct 2013 16:06] Jon Stephens
Fixed in MySQL 5.5.35, 5.6.15, 5.7.3. No changelog entry needed, since change is not visible to users. Closed.