Bug #12190 CHANGE MASTER has differ path requiremts on MASTER_LOG_FILE and RELAY_LOG_FILE
Submitted: 27 Jul 2005 0:00 Modified: 12 Nov 13:44
Reporter: Guilhem Bichot
Status: Closed
Category:Server: Replication Severity:S3 (Non-critical)
Version:5.0 OS:Linux (linux)
Assigned to: Zhenxing He Target Version:6.0
Triage: Triaged: D4 (Minor) / R2 (Low) / E3 (Medium)

[27 Jul 2005 0: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 10: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 8: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 11: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 14:22] Zhenxing He
pushed to 6.0-rpl
[13 May 5: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 11: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 10: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 10: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 10: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 19:15] Jon Stephens
Already documented in 6.0.12 changelog; closed w/o further action.
[12 Nov 9: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 13:44] Jon Stephens
Also documented in the 5.5.0 changelog; closed.
[8 Dec 4:06] Donna Harmon
Bug #38989 appears to be a duplicate