Bug #44442 Incident events are silent in mysqlbinlog output
Submitted: 23 Apr 2009 17:03 Modified: 25 Jun 2009 10:49
Reporter: Mats Kindahl Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.1 OS:Any
Assigned to: Mats Kindahl CPU Architecture:Any
Tags: mysqlbinlog

[23 Apr 2009 17:03] Mats Kindahl
Description:
If a binary log contain an incident log event and mysqlbinlog is applied to it, all that shows in the output is a comment containing the error message.

If that output is fed into a running server, it will apply correctly, even though the incident log event indicates that, e.g., the database need to be re-synchronized.

How to repeat:
Run mysqlbinlog on a binary log with an incident log event and check the output.

Suggested fix:
Write a non-existing command into the output, which will generate a syntax error and force the DBA to resolve the issues somehow.
[30 Apr 2009 13:59] 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/73169

2872 Mats Kindahl	2009-04-30
      Bug #44442: Incident events are silent in mysqlbinlog output
      
      In the output from mysqlbinlog, incident log events were
      represented as just a comment. Since the incident log event
      represents an incident that could cause the contents of the
      database to change without being logged to the binary log,
      it means that if the SQL is applied to a server, it could
      potentially lead to that the databases are out of sync.
      
      In order to handle that, this patch adds the statement "RELOAD
      DATABASE" to the SQL output for the incident log event. This will
      require a DBA to edit the file and handle the case as apropriate
      before applying the output to a server.
     @ mysql-test/suite/binlog/std_data/binlog_incident-bug44442.sql
        Reference for mysqlbinlog output.
     @ mysql-test/suite/binlog/t/binlog_incident-master.opt
        Options file to cause server to generate an incident log
        event when executing a REPLACE.
     @ mysql-test/suite/binlog/t/binlog_incident.test
        Test to check that the incident log event is represented
        correctly in the output from mysqlbinlog.
     @ sql/log_event.cc
        The incident log event now ouput a "RELOAD DATABASE" instead
        of just a comment. RELOAD DATABASE is not an existing command
        and will generate a syntax error.
[8 May 2009 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/73655

2873 Mats Kindahl	2009-05-08
      Bug #44442: Incident events are silent in mysqlbinlog output
      
      Incremental patch to add newline to reference file for
      mysqlbinlog output.
     @ mysql-test/suite/binlog/std_data/binlog_incident-bug44442.sql
        Updating template to include a newline.
[11 May 2009 11:33] 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/73737

2872 Mats Kindahl	2009-05-11
      Bug #44442: Incident events are silent in mysqlbinlog output
            
      In the output from mysqlbinlog, incident log events were
      represented as just a comment. Since the incident log event
      represents an incident that could cause the contents of the
      database to change without being logged to the binary log,
      it means that if the SQL is applied to a server, it could
      potentially lead to that the databases are out of sync.
      
      In order to handle that, this patch adds the statement "RELOAD
      DATABASE" to the SQL output for the incident log event. This will
      require a DBA to edit the file and handle the case as apropriate
      before applying the output to a server.
     @ mysql-test/suite/binlog/t/binlog_incident-master.opt
        Options file to cause server to generate an incident log
        event when executing a REPLACE.
     @ mysql-test/suite/binlog/t/binlog_incident.test
        Test to check that the incident log event is represented
        correctly in the output from mysqlbinlog.
     @ sql/log_event.cc
        The incident log event now ouput a "RELOAD DATABASE" instead
        of just a comment. RELOAD DATABASE is not an existing command
        and will generate a syntax error.
[11 May 2009 14: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/73770

3268 Mats Kindahl	2009-05-11 [merge]
      Merging BUG#44442 into 6.0-bugteam.
[14 May 2009 19:58] 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/74106

3279 Mats Kindahl	2009-05-14
      BUG#44442: Incident events are silent in mysqlbinlog output
      
      Updating start position since format description log event
      is one byte longer in 6.0 than in 5.1.
[28 May 2009 8:21] Bugs System
Pushed into 5.1.36 (revid:joro@sun.com-20090528073639-yohsb4q1jzg7ycws) (version source revid:mats@sun.com-20090511113238-x4ogj5v0uddz6ktm) (merge vers: 5.1.35) (pib:6)
[28 May 2009 15:02] Jon Stephens
Documented bugfix in the 5.1.36 changelog as follows:

        Previously, incident log events were represented as comments in
        the output from mysqlbinlog, making them effectively silent when
        playing back the binlog.

        (An incident log event represents an incident that could cause
        the contents of the database to change without that event being
        recorded in the binary log.)

        This meant that, if the SQL were applied to a server, it could
        potentially lead to the master and the slave having different 
        data. To make it possible to handle incident log
        events without breaking applications that expect the previous
        behavior, the nonsense statement RELOAD DATABASE is added to the
        SQL output for that incident log event, which causes an error.

        To use this functionality currently requires hand editing of the
        dump file and handling of each case on an individual basis by a
        database administrator before applying the output to a server.

Set NDI status while waiting for push to 5.1+.
[17 Jun 2009 19:27] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090616183122-chjzbaa30qopdra9) (version source revid:mats@sun.com-20090514195803-58o180h5429a1hse) (merge vers: 6.0.12-alpha) (pib:11)
[25 Jun 2009 10:49] Jon Stephens
Bugfix now also documented in the 5.4.4 changelog. Closed.
[12 Aug 2009 21:38] Paul DuBois
Noted in 5.4.2 changelog because next 5.4 version will be 5.4.2 and not 5.4.4.
[14 Aug 2009 22:37] Paul DuBois
Ignore previous comment about 5.4.2.
[5 Oct 2009 18:02] Paul DuBois
This fix now has been pushed into 5.4.2.