Bug #27779 Slave cannot read old rows log events.
Submitted: 12 Apr 2007 8:51 Modified: 6 Feb 2008 11:12
Reporter: Mats Kindahl Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Row Based Replication ( RBR ) Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Sven Sandberg CPU Architecture:Any
Triage: D2 (Serious)

[12 Apr 2007 8:51] Mats Kindahl
Description:
With the introduction of BUG#22583, the slave cannot read old row events but will instead stop with an error about an unknown error.

How to repeat:
Take a binary log from an old (pre 5.1.18) master and feed it to a new slave.

Suggested fix:
Copy the old code for reading events, and add support for decoding them.
[12 Apr 2007 13:51] 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/24383

ChangeSet@1.2545, 2007-04-12 15:50:54+02:00, mats@romeo.(none) +11 -0
  BUG#27779 (Slave cannot read old rows log events):
  
  Taking code from before BUG#22583 and incorporating as events to be able
  to read old events. Also incorporating old pack and unpack functions
  into patch.
[12 Apr 2007 15:33] Rafal Somla
Good to push.
[20 Apr 2007 17:16] Bugs System
Pushed into 5.1.18-beta
[24 Apr 2007 17:21] Paul Dubois
Noted in 5.1.18 changelog.

A binary log incompatiblity introduced by the fix for Bug #22583 
was corrected.
[3 Jan 2008 15:52] 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/40512

ChangeSet@1.2658, 2008-01-03 16:52:18+01:00, sven@riska.(none) +2 -0
  BUG#27779: Slave cannot read old rows log events.
  Problem: Some previous versions use a different binlog format. In order
  to replicate from old versions to new versions, the new version must be
  aware of all old formats. This patch fixes one of several issues when
  replicating from mysql-5.1-wl2325-5.0-drop6 to mysql-5.1-new-rpl.
  Specifically, in mysql-5.1-wl2325-5.0-drop6, the event type id's were
  different than in mysql-5.1-new-rpl.
  Fix (in mysql-5.1-new-rpl):
   (1) detect that the server that generated the events uses the old
  format, by checking the server version of the format_description_log_event
  This patch recognizes mysql-5.1-wl2325-5.0-drop6 and -drop5.
   (2) if the generating server is old, map old event types to new event
  types using a permutation array.
  
  This fixes part of the bug (specifically, mysqlbinlog can read the
  binlog rpl_bug27779_a.dat attached to the bug report for BUG#27779
  without problems). However, there are remaining problems with replicating
  from mysql-5.1-wl2325-5.0-drop6 to mysql-5.1-new-rpl (specifically, the
  test case for BUG#27779 fails: when the output of
  'mysqlbinlog rpl_bug27779_a.dat' is piped to a client, the client fails to
  execute an Update_rows_log_event).
[7 Jan 2008 14:34] 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/40640

ChangeSet@1.2658, 2008-01-07 15:34:51+01:00, sven@riska.(none) +2 -0
  BUG#27779: Slave cannot read old rows log events.
  Problem: Some previous versions use a different binlog format. In order
  to replicate from old versions to new versions, the new version must be
  aware of all old formats. This patch fixes one of several issues when
  replicating from mysql-5.1-wl2325-5.0-drop6 to mysql-5.1-new-rpl.
  Specifically, in mysql-5.1-wl2325-5.0-drop6, the event type id's were
  different than in mysql-5.1-new-rpl.
  Fix (in mysql-5.1-new-rpl):
   (1) detect that the server that generated the events uses the old
  format, by checking the server version of the format_description_log_event
  This patch recognizes mysql-5.1-wl2325-5.0-drop6 and -drop5.
   (2) if the generating server is old, map old event types to new event
  types using a permutation array.
  
  This fixes part of the bug (specifically, mysqlbinlog can read the
  binlog rpl_bug27779_a.dat attached to the bug report for BUG#27779
  without problems). However, there are remaining problems with replicating
  from mysql-5.1-wl2325-5.0-drop6 to mysql-5.1-new-rpl (specifically, the
  test case for BUG#27779 fails: when the output of
  'mysqlbinlog rpl_bug27779_a.dat' is piped to a client, the client fails to
  execute an Update_rows_log_event).
[9 Jan 2008 10: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/40745

ChangeSet@1.2658, 2008-01-09 11:34:39+01:00, sven@riska.(none) +2 -0
  BUG#27779: Slave cannot read old rows log events.
  Problem: Some previous versions use a different binlog format. In order
  to replicate from old versions to new versions, the new version must be
  aware of all old formats. This patch fixes one of several issues when
  replicating from mysql-5.1-wl2325-5.0-drop6 to mysql-5.1-new-rpl.
  Specifically, in mysql-5.1-wl2325-5.0-drop6, the event type id's were
  different than in mysql-5.1-new-rpl.
  Fix (in mysql-5.1-new-rpl):
   (1) detect that the server that generated the events uses the old
  format, by checking the server version of the format_description_log_event
  This patch recognizes mysql-5.1-wl2325-5.0-drop6p13-alpha,
  mysql-5.1-wl2325-5.0-drop6, mysql-5.1-wl2325-5.0, mysql-5.1-wl2325-no-dd.
   (2) if the generating server is old, map old event types to new event
  types using a permutation array.
  
  This fixes part of the bug (specifically, mysqlbinlog can read the
  binlog rpl_bug27779_a.dat attached to the bug report for BUG#27779
  without problems). However, there are remaining problems with replicating
  from mysql-5.1-wl2325-5.0-drop6 to mysql-5.1-new-rpl (specifically, the
  test case for BUG#27779 fails: when the output of
  'mysqlbinlog rpl_bug27779_a.dat' is piped to a client, the client fails to
  execute an Update_rows_log_event).
[10 Jan 2008 15:38] 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/40851

ChangeSet@1.2660, 2008-01-10 16:39:44+01:00, sven@riska.(none) +9 -0
  BUG#27779: Slave cannot read old rows log events.
  Problem: Replication fails when master is mysql-5.1-wl2325-5.0-drop6 and
  slave is mysql-5.1-new-rpl. The reason is that, in
  mysql-5.1-wl2325-5.0-drop6, the event type id's were different than in
  mysql-5.1-new-rpl.
  Fix (in mysql-5.1-new-rpl):
   (1) detect that the server that generated the events uses the old
  format, by checking the server version of the format_description_log_event
  This patch recognizes mysql-5.1-wl2325-5.0-drop6p13-alpha,
  mysql-5.1-wl2325-5.0-drop6, mysql-5.1-wl2325-5.0, mysql-5.1-wl2325-no-dd.
   (2) if the generating server is old, map old event types to new event
  types using a permutation array.
  
  I've also added a test case which reads binlogs for four different
  versions.
[10 Jan 2008 15:42] Sven Sandberg
the binlogs for the test case

Attachment: binlogs-b27779.tar.gz (application/x-gzip, text), 6.20 KiB.

[5 Feb 2008 13:03] Bugs System
Pushed into 5.1.24-rc
[5 Feb 2008 13:07] Bugs System
Pushed into 6.0.5-alpha
[6 Feb 2008 11:12] Jon Stephens
Documented bugfix in 5.1.24 and 6.0.5 changelogs as follows:

        Slaves running MySQL 5.1.18 and later could not read binary logs
        from older versions of the server.

(Note: Could not find changelog entry from earlier fix for this bug, so no need to change it.)
[15 Feb 2008 13:40] Bugs System
Pushed into 5.1.24-rc
[15 Feb 2008 13:42] Bugs System
Pushed into 6.0.5-alpha
[6 Mar 2008 5:51] Jon Stephens
Fix also documented for 5.1.23-ndb-6.2.14.
[30 Mar 2008 8:37] Jon Stephens
Fix also noted in the 5.1.23-ndb-6.3.11 changelog.