Bug #43407 SET GLOBAL SQL_SLAVE_SKIP_COUNTER should log previous state in error log
Submitted: 5 Mar 2009 10:51 Modified: 16 Dec 2010 2:35
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:51] Johan Idrén
Description:
When executing SET GLOBAL SQL_SLAVE_SKIP_COUNTER, it's easy to break replication. In some cases, it would be beneficial to know which position the slave was at when executed. This could mean the difference between a recoverable data and useless data.

How to repeat:
mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER=11;

Realize you should have written 1, not 11.

Try to find where you were in replication, realize you didn't write it down.

Re-image slave, if possible. Time consuming and maybe not possible if master has been corrupted/destroyed.

Suggested fix:
For every SQL_SLAVE_SKIP_COUNTER, log current binlog position.

Example:

mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER=11;

In log:

YYYY-MM-DD [INFO] SQL_SLAVE_SKIP_COUNTER=11 executed at master_binlog_pos 106, master_binlog_file mysql-bin.000020, new master_binlog_pos 556, master_binlog_file mysql-bin.000020
[18 Feb 2010 16: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/100780

2968 Alfranio Correia	2010-02-18
      BUG#43407 SET GLOBAL SQL_SLAVE_SKIP_COUNTER should log previous state in error log
      
      When issuing a 'SET GLOBAL SQL_SLAVE_SKIP_COUNTER' statement, the previous
      position along with the new position is dumped into the error log. Namely,
      the following information is printed out: skip_counter, group_relay_log_name
      and group_relay_log_pos.
[18 Mar 2010 10:03] 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/103661

2968 Alfranio Correia	2010-03-18
      BUG#43407 SET GLOBAL SQL_SLAVE_SKIP_COUNTER should log previous state in error log
      
      When issuing a 'SET GLOBAL SQL_SLAVE_SKIP_COUNTER' statement, the previous
      position along with the new position is dumped into the error log. Namely,
      the following information is printed out: skip_counter, group_relay_log_name
      and group_relay_log_pos.
[4 May 2010 9:42] 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/107269

3368 Alfranio Correia	2010-05-04
      BUG#43407 SET GLOBAL SQL_SLAVE_SKIP_COUNTER should log previous state in error log
            
      When issuing a 'SET GLOBAL SQL_SLAVE_SKIP_COUNTER' statement, the previous
      position along with the new position is dumped into the error log. Namely,
      the following information is printed out: skip_counter, group_relay_log_name
      and group_relay_log_pos.
[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 12:09] Jon Stephens
Documented bugfix in the 5.1.47 changelog. See BUG#43406 for docs info.

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:07] Jon Stephens
Also documented in the 5.5.5 and 6.0.14 changelogs, updated 5.5 and 6.0 versions of Manual with changes.

See BUG#43406 for details.

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:35] 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:35] Jon Stephens
See BUG#43406 for docs info.