Bug #43406 CHANGE MASTER TO should log previous state in error log
Submitted: 5 Mar 2009 10:41 Modified: 16 Dec 2010 2:36
Reporter: Johan Idrén Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:5.1, 6.0 OS:Any
Assigned to: Alfranio Correia CPU Architecture:Any
Triage: Triaged: D5 (Feature request) / R2 (Low) / E2 (Low)

[5 Mar 2009 10:41] Johan Idrén
Description:
When issuing a CHANGE MASTER TO statement, it would be good if the previous state of replication was dumped into the error log.

How to repeat:
mysql> STOP SLAVE;
mysql> CHANGE MASTER TO master_host='some.host.com', master_log_pos=106, master_log_file='mysql-bin.000025';

Nothing in error log

Suggested fix:
mysql> STOP SLAVE;
mysql> CHANGE MASTER TO master_host='some.host.com', master_log_pos=106, master_log_file='mysql-bin.000025';

In error log:

YYYY-MM-DD [INFO] CHANGE MASTER TO executed.
Previous state, master_host='one.host.com', master_log_pos=500, master_log_file='mysql-bin.000020'
New state, master_host='some.host.com', master_log_pos=106, master_log_file='mysq-bin.000025'

Passwords stripped of course.
[18 Feb 2010 14:23] 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/100761

2968 Alfranio Correia	2010-02-18
      BUG#43406 CHANGE MASTER TO should log previous state in error log
      
      When issuing a 'CHANGE MASTER TO' statement, key elements of the previous
      state, namely the host, the master_log_file and the master_log_pos are
      dumped into the error log.
[26 Feb 2010 11:16] 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/101579

2968 Alfranio Correia	2010-02-26
      BUG#43406 CHANGE MASTER TO should log previous state in error log
      
      When issuing a 'CHANGE MASTER TO' statement, key elements of the previous
      state, namely the host, port, the master_log_file and the master_log_pos
      are dumped into the error log.
[4 May 2010 9:17] 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/107266

3367 Alfranio Correia	2010-05-04
      BUG#43406 CHANGE MASTER TO should log previous state in error log
            
      When issuing a 'CHANGE MASTER TO' statement, key elements of the previous
      state, namely the host, port, the master_log_file and the master_log_pos
      are dumped into the error log.
[5 May 2010 15:03] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:alfranio.correia@sun.com-20100504221510-yi5du89c3xti2vbw) (merge vers: 5.1.47) (pib:16)
[6 May 2010 11:41] Jon Stephens
Documented bugfix in the 5.1.47 changelog as follows:

      When invoked, CHANGE MASTER TO now causes information about the state
      prior to execution to be written to the error log. This information
      includes the previous values for host, port, master_log_file and
      master_log_pos.

Set status = NM, waiting for merges to >5.1 trees based on '5.1+' target.
[6 May 2010 12:03] Jon Stephens
Disregard my previous comment.
[6 May 2010 12:07] Jon Stephens
Documented together with fix for BUG#43407 in the 5.1.47 changelog, as follows:

        When invoked, CHANGE MASTER TO and SET GLOBAL 
        sql_slave_skip_counter now cause information to be written 
        to the error log about the slave's state prior to execution of 
        the statement. For CHANGE MASTER TO, this information includes 
        the previous values for MASTER_HOST, MASTER_PORT, 
        MASTER_LOG_FILE, and MASTER_LOG_POS. For SET GLOBAL
        SQL_SLAVE_SKIP_COUNTER, this information includes the previous 
        values of sql_slave_skip_counter, the group relay log name, and 
        the group relay log position.

Also updated descriptions of CHANGE MASTER TO, SET GLOBAL sql_slave_skip_counter in the 5.1 Manual.

Status = NM, waiting for post-5.1 merges.
[28 May 2010 6:06] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:alik@sun.com-20100512070920-xgpmqeytp0gc183c) (pib:16)
[28 May 2010 6:34] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:alik@sun.com-20100507093037-7cykrx1n73v0tetc) (merge vers: 6.0.14-alpha) (pib:16)
[28 May 2010 7:02] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:alexey.kopytov@sun.com-20100508220335-xsvmtj21h4yeu8mf) (merge vers: 5.5.5-m3) (pib:16)
[3 Jun 2010 8:06] Jon Stephens
Also documented bugfix in the 5.5.5 and 6.0.14 changelogs, updated descriptions of CHANGE MASTER TO, SET GLOBAL sql_slave_skip_counter in the
5.5/6.0 Manuals.

Closed.
[17 Jun 2010 12:10] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:martin.skold@mysql.com-20100616204905-jxjg342w35ks9vfy) (merge vers: 5.1.47-ndb-7.0.16) (pib:16)
[17 Jun 2010 12:57] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:martin.skold@mysql.com-20100615090726-jotpykke96le59w5) (merge vers: 5.1.47-ndb-6.2.19) (pib:16)
[17 Jun 2010 13:37] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:martin.skold@mysql.com-20100616120453-jh7wr05z1vf7r8pm) (merge vers: 5.1.47-ndb-6.3.35) (pib:16)
[16 Dec 2010 2:36] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.
[16 Dec 2010 2:37] Jon Stephens
See http://lists.mysql.com/commits/127020 for update to docs.

Thanks.