Bug #35542 Add option to sync master and relay log to disk after every event
Submitted: 25 Mar 2008 6:50 Modified: 12 Nov 2009 15:03
Reporter: Johan Idrén Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:5.0 OS:Any
Assigned to: Zhenxing He CPU Architecture:Any

[25 Mar 2008 6:50] Johan Idrén
Description:
As per bug#26540 when a replication slave crashes, the point of replication can be lost. 

How to repeat:
Disconnect power to a replication slave and start it up again, you will not know where in it's replication status it is.

Suggested fix:
Add option to fsync master and relay logs after every event is completed. 

I do realize this will incur a big performance hit due to the increased fsync calls, however bug#26540 does not appear to be fixed until 6.0 at the earliest.
[23 Jun 2008 13:25] MySQL Verification Team
The experiment for the proof-of-concept for the fix of this deficiency

Attachment: experiment.tar.gz (application/x-tar, text), 62.38 KiB.

[25 Jun 2008 13:34] Lars Thalmann
See also BUG#31665.
[7 Jul 2008 8:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/49066

2611 He Zhenxing	2008-07-07
      BUG#31665 sync_binlog should cause relay logs to be synchronized
      BUG#35542 Add option to sync master and relay log to disk after every event
      
      Add sync_relay_log option to server, this option works for relay log 
      the same as option sync_binlog for binlog. This option also synchronize
      master info to disk when set to non-zero value.
      
      Original patches from Sinisa and Mark, with some modifications
[10 Jul 2008 12:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/49433

2611 He Zhenxing	2008-07-10
      BUG#31665 sync_binlog should cause relay logs to be synchronized
      BUG#35542 Add option to sync master and relay log to disk after every event
      
      Add sync_relay_log option to server, this option works for relay log 
      the same as option sync_binlog for binlog. This option also synchronize
      master info to disk when set to non-zero value.
      
      Original patches from Sinisa and Mark, with some modifications
[11 Jul 2008 8:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/49536

2611 He Zhenxing	2008-07-11
      BUG#31665 sync_binlog should cause relay logs to be synchronized
      BUG#35542 Add option to sync master and relay log to disk after every event
      
      Add sync_relay_log option to server, this option works for relay log 
      the same as option sync_binlog for binlog. This option also synchronize
      master info to disk when set to non-zero value.
      
      Original patches from Sinisa and Mark, with some modifications
[21 Jul 2008 10:21] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50107

2611 He Zhenxing	2008-07-21
      BUG#31665 sync_binlog should cause relay logs to be synchronized
      BUG#35542 Add option to sync master and relay log to disk after every event
      
      Add sync_relay_log option to server, this option works for relay log 
      the same as option sync_binlog for binlog. This option also synchronize
      master info to disk when set to non-zero value.
      
      Original patches from Sinisa and Mark, with some modifications
[22 Jul 2008 2:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50154

2673 He Zhenxing	2008-07-22
      BUG#35542 Add option to sync master and relay log to disk after every event
      BUG#31665 sync_binlog should cause relay logs to be synchronized
      
      Add sync_relay_log option to server, this option works for relay log 
      the same as option sync_binlog for binlog. This option also synchronize
      master info to disk when set to non-zero value.
            
      Original patches from Sinisa and Mark, with some modifications
[22 Jul 2008 2:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50155

2673 He Zhenxing	2008-07-22
      BUG#35542 Add option to sync master and relay log to disk after every event
      BUG#31665 sync_binlog should cause relay logs to be synchronized
      
      Add sync_relay_log option to server, this option works for relay log 
      the same as option sync_binlog for binlog. This option also synchronize
      master info to disk when set to non-zero value.
            
      Original patches from Sinisa and Mark, with some modifications
[22 Jul 2008 6:30] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50160

2674 He Zhenxing	2008-07-22 [merge]
      BUG#35542 Add option to sync master and relay log to disk after every event
      BUG#31665 sync_binlog should cause relay logs to be synchronized
      
      Manual merge
[22 Jul 2008 6:45] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50161

2674 He Zhenxing	2008-07-22 [merge]
      BUG#35542 Add option to sync master and relay log to disk after every event
      BUG#31665 sync_binlog should cause relay logs to be synchronized
      
      Manual merge
[22 Jul 2008 8:45] Zhenxing He
pushed to mysql-6.0-rpl
[22 Sep 2008 13:39] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/54453

2636 He Zhenxing	2008-09-22
      BUG#35542 Add option to sync master and relay log to disk after every event
      BUG#31665 sync_binlog should cause relay logs to be synchronized
      
      This patch also sync relay log info if --sync-relay-log is set to a
      value other than zero.
[27 Oct 2008 4:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/57081

2706 Alfranio Correia	2008-10-27
      Merged patch that was proposed by Sinisa and modified by He Zhenxing to
      fix bugs: BUG#35542 and BUG#31665. This is an update to BUG#40337.
[27 Oct 2008 15:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/57114

2704 Alfranio Correia	2008-10-27
      Merged patch that was proposed by Sinisa and modified by He Zhenxing to fix bugs: BUG#35542 and BUG#31665. This is an update to BUG#40337.
      And introduced a new recovery process that disregards old relay-log.bin(s) and starts
      re-fetching from the master based on the information in relay-log.info which may be flushed and synced after each transaction commit.
[29 Oct 2008 17:53] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/57346

2704 Alfranio Correia	2008-10-29
      Added option to sync master.info (--sync-master-info, integer) and relay log (--sync-relay-log, integer) to disk after every event and the relay info (--sync-relay-log-info, boolean) per transaction. This supersedes the patch proposed by Sinisa and modified by He Zhenxing 
      to fix bugs: BUG#35542 and BUG#31665. This is an update to BUG#40337.
[7 Nov 2008 19:22] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/58228

2704 Alfranio Correia	2008-11-07
      Added option to sync master.info (--sync-master-info, integer) 
      and relay log (--sync-relay-log, integer) to disk after 
      every event and the relay info (--sync-relay-log-info, boolean) per transaction. 
      This supersedes the patch proposed 
      by Sinisa and modified by He Zhenxing to fix bugs: BUG#35542 and BUG#31665. This is an update to BUG#40337.
[11 Nov 2008 11:27] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/58440

2704 Alfranio Correia	2008-11-11
      Added option to sync master.info (--sync-master-info, integer) and relay log (--sync-relay-log, integer) to disk after
      every event and the relay info (--sync-relay-log-info, boolean) per transaction.
      This supersedes the patch proposed by Sinisa and modified by He Zhenxing to fix bugs: BUG#35542 and BUG#31665. 
      This is an update to BUG#40337.
[30 Jan 2009 13:26] Bugs System
Pushed into 6.0.10-alpha (revid:luis.soares@sun.com-20090129165607-wiskabxm948yx463) (version source revid:luis.soares@sun.com-20090129163120-e2ntks4wgpqde6zt) (merge vers: 6.0.10-alpha) (pib:6)
[4 Feb 2009 15:11] Jon Stephens
Added changelog entry, info for --sync-relay-log to 6.0.10 changelog.

See Bug #31665 for details.

Set status to NDI pending additional patches merging to 6.0 tree (per discussion with Lars and Alfranio).
[17 Feb 2009 10:00] Lars Thalmann
This is fixed and pushed to 6.0 although there are other
improvements (BUG#40337) in progress.  Setting back to
"documenting" state so that this bug can be closed.
[17 Feb 2009 13:34] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html
[29 Sep 2009 14:28] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/85039

3118 Alfranio Correia	2009-09-29
      BUG#35542 Add option to sync master and relay log to disk after every event
      BUG#31665 sync_binlog should cause relay logs to be synchronized
      
      NOTE: Backporting the patch to next-mr.
            
      Add sync_relay_log option to server, this option works for relay log 
      the same as option sync_binlog for binlog. This option also synchronize
      master info to disk when set to non-zero value.
                  
      Original patches from Sinisa and Mark, with some modifications
[27 Oct 2009 9:47] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091027094604-9p7kplu1vd2cvcju) (version source revid:zhenxing.he@sun.com-20091026140226-uhnqejkyqx1aeilc) (merge vers: 6.0.14-alpha) (pib:13)
[27 Oct 2009 19:11] Jon Stephens
Already documented in 6.0.10/6.0.11. Closed.
[12 Nov 2009 8:15] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091110093229-0bh5hix780cyeicl) (version source revid:alik@sun.com-20091027095744-rf45u3x3q5d1f5y0) (merge vers: 5.5.0-beta) (pib:13)
[12 Nov 2009 15:03] Jon Stephens
Also documented bugfix in the 5.5.0 changelog; closed.