Bug #12190 CHANGE MASTER has differ path requiremts on MASTER_LOG_FILE and RELAY_LOG_FILE
Submitted: 26 Jul 2005 22:00 Modified: 28 Jan 2011 12:19
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.0 OS:Linux (linux)
Assigned to: Zhenxing He
Triage: Triaged: D4 (Minor) / R2 (Low) / E3 (Medium)

[26 Jul 2005 22:00] Guilhem Bichot
Description:
should be tested with 4.1 too.
See how-to-repeat for an example of the inconsistency

How to repeat:
Start master with --log-bin=/tmp/binos. Start slave with --relay-log=/tmp/relaybinos. Set up replication running.
In /tmp you should have binos.* files, and relaybinos.* files:
[guilhem 23:49 ~] cat /tmp/relaybinos.index
/tmp/relaybinos.000003
[guilhem 23:49 ~] cat /tmp/binos.index
/tmp/binos.000001
Now do on slave:
change master to master_log_file="/tmp/binos.000001"; start slave;
and see that it fails to start, with this error in the log:
050726 23:49:48 [ERROR] Error reading packet from server: Could not find first log file name in binary log index file ( server_errno=1236)
050726 23:49:48 [ERROR] Got fatal error 1236: 'Could not find first log file name in binary log index file' from master when reading data from binary log
Now do on slave:
stop slave; change master to master_log_file="binos.000001"; start slave;
and see it succeeds starting. So master automatically appends /tmp to the requested binlog name and searches for the resulting string in its /tmp/binos.index file.
Now do on slave:
stop slave; change master to relay_log_file="relaybinos.000002"; start slave;
(check that /tmp/relaybinos.000002 exists, if not, use the proper numeric extension),
and see that slave fails to start:
ERROR 1380 (HY000): Failed initializing relay log position: Could not find target log during relay log initialization
Now do on slave:
stop slave; change master to relay_log_file="/tmp/relaybinos.000002"; start slave;
and see it succeeds.
So slave does NOT append /tmp to the requested relay log name, it just searches for this name in its /tmp/relay-binos.index.
That is the inconsistency: master appends /tmp before searching while slave does not. This is confusing for our users.

Suggested fix:
fix the slave to behave like master: it has to automatically put /tmp at the front. Don't do it the other way, don't force an exact path in MASTER_LOG_FILE.
Keep MattL informed about this bug.
[26 Mar 2009 9:41] 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/70503

2821 He Zhenxing	2009-03-26
      BUG#12190 CHANGE MASTER has differ path requiremts on MASTER_LOG_FILE and RELAY_LOG_FILE
      
      CHANGE MASTER TO command required the value for RELAY_LOG_FILE to
      be an absolute path, which was different from the requirement of
      MASTER_LOG_FILE.
      
      This patch fixed the problem by changed the value for RELAY_LOG_FILE
      to be the basename of the log file as that for MASTER_LOG_FILE.
[31 Mar 2009 6:26] 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/70856

2821 He Zhenxing	2009-03-31
      BUG#12190 CHANGE MASTER has differ path requiremts on MASTER_LOG_FILE and RELAY_LOG_FILE
      
      CHANGE MASTER TO command required the value for RELAY_LOG_FILE to
      be an absolute path, which was different from the requirement of
      MASTER_LOG_FILE.
      
      This patch fixed the problem by changing the value for RELAY_LOG_FILE
      to be the basename of the log file as that for MASTER_LOG_FILE.
[21 Apr 2009 9:40] 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/72555

2845 He Zhenxing	2009-04-21
      BUG#12190 CHANGE MASTER has differ path requiremts on MASTER_LOG_FILE and RELAY_LOG_FILE
      
      CHANGE MASTER TO command required the value for RELAY_LOG_FILE to
      be an absolute path, which was different from the requirement of
      MASTER_LOG_FILE.
      
      This patch fixed the problem by changing the value for RELAY_LOG_FILE
      to be the basename of the log file as that for MASTER_LOG_FILE.
[21 Apr 2009 12:22] Zhenxing He
pushed to 6.0-rpl
[13 May 2009 3:31] Bugs System
Pushed into 6.0.12-alpha (revid:alik@sun.com-20090513032549-rxa73jbxd1qv09xc) (version source revid:aelkin@mysql.com-20090429125820-vu261kl1z4z5f0iv) (merge vers: 6.0.12-alpha) (pib:6)
[26 May 2009 9:38] Jon Stephens
Documented bugfix as follows in the 6.0.12 changelog:

        The CHANGE MASTER TO statement required the value for RELAY_LOG_FILE
        to be an absolute path, while the MASTER_LOG_FILE path could be
        relative.

        This issue is resolved by using the same basename for
        RELAY_LOG_FILE as for MASTER_LOG_FILE. For more information, see
        <xref linkend="change-master-to"/>.
[2 Oct 2009 8:35] 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/85480

3120 He Zhenxing	2009-10-02
      Backport BUG#12190 CHANGE MASTER has differ path requiremts on MASTER_LOG_FILE and RELAY_LOG_FILE
      
      CHANGE MASTER TO command required the value for RELAY_LOG_FILE to
      be an absolute path, which was different from the requirement of
      MASTER_LOG_FILE.
      
      This patch fixed the problem by changing the value for RELAY_LOG_FILE
      to be the basename of the log file as that for MASTER_LOG_FILE.
[2 Oct 2009 8:40] 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/85482

3121 He Zhenxing	2009-10-02
      Backport post fix compiler warnings and test failures for BUG#25192 BUG#12190
[27 Oct 2009 9:48] 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 18:15] Jon Stephens
Already documented in 6.0.12 changelog; closed w/o further action.
[12 Nov 2009 8:21] 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 12:44] Jon Stephens
Also documented in the 5.5.0 changelog; closed.
[8 Dec 2009 3:06] Donna Harmon
Bug #38989 appears to be a duplicate
[2 Mar 2010 0:59] Roel Van de Paar
May affect bug #33048
[3 Aug 2010 9:02] Holger Thiel
I used the binlogs from the master.
I had to fix the relay index file to make it work (MySQL 5.0.91).
[17 Jan 2011 19:00] Bugs System
Pushed into mysql-trunk 5.6.2 (revid:luis.soares@oracle.com-20110117185804-9z9v2q49jwjzr273) (version source revid:luis.soares@oracle.com-20110117185639-7g42rzm6eyzf3x10) (merge vers: 5.6.2) (pib:24)
[17 Jan 2011 19:00] Bugs System
Pushed into mysql-5.5 5.5.10 (revid:luis.soares@oracle.com-20110117185101-zhm6zj89s6v00jbh) (version source revid:luis.soares@oracle.com-20110117185101-zhm6zj89s6v00jbh) (merge vers: 5.5.10) (pib:24)
[27 Jan 2011 19:30] Jon Stephens
Also documented in the 5.6.2 changelog and the description of CHANGE MASTER TO in the 5.6 Manual.

Closed.
[28 Jan 2011 12:19] Jon Stephens
Already documented in 5.5; see above. Setting back to Closed.