Bug #38734 rpl_server_id2 sync_with_master failed
Submitted: 12 Aug 2008 3:37 Modified: 2 Feb 2009 15:35
Reporter: Zhenxing He Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Zhenxing He CPU Architecture:Any
Tags: 51rpl

[12 Aug 2008 3:37] Zhenxing He
Description:
rpl_server_id2 test failed:

mysqltest: At line 18: sync_with_master failed: 'select master_pos_wait('slave-bin.000001', 194, 300)' returned NULL indicating slave SQL thread failure

How to repeat:
https://intranet.mysql.com/secure/pushbuild/getlog.pl?dir=bzr_mysql-5.1-rpl&entry=Magnus_S...
[22 Aug 2008 5:07] 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/52280

2661 He Zhenxing	2008-08-22
      BUG#38734 rpl_server_id2 sync_with_master failed
      
      Rotate event is automatically generated and written when rotating binary
      log or relay log. Rotate events for relay logs are usually ignored by slave
      SQL thread becuase they have the same server id as that of the slave.
      However, if --replicate-same-server-id is enabled, rotate event
      for relay log would be treated as if it's a rotate event from master, and
      would be executed by slave to update the rli->group_master_log_name and
      rli->group_master_log_pos to a wrong value and cause the MASTER_POS_WAIT
      function to fail and return NULL.
      
      This patch fixed this problem by setting a flag bit in the event to tell the
      SQL thread to ignore these Rotate events generated for relay logs.
[10 Sep 2008 7:11] 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/53663

2666 He Zhenxing	2008-09-10
      BUG#38734 rpl_server_id2 sync_with_master failed
      
      Rotate event is automatically generated and written when rotating binary
      log or relay log. Rotate events for relay logs are usually ignored by slave
      SQL thread becuase they have the same server id as that of the slave.
      However, if --replicate-same-server-id is enabled, rotate event
      for relay log would be treated as if it's a rotate event from master, and
      would be executed by slave to update the rli->group_master_log_name and
      rli->group_master_log_pos to a wrong value and cause the MASTER_POS_WAIT
      function to fail and return NULL.
      
      This patch fixed this problem by setting a flag bit (LOG_EVENT_RELAY_LOG_F)
      in the event to tell the SQL thread to ignore these Rotate events generated
      for relay logs.
      
      This patch also added another binlog event flag bit (LOG_EVENT_ARTIFICIAL_F)
      to distinquish faked events, the method used before this was by checking if
      log_pos was zero.
[11 Sep 2008 6:00] 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/53765

2666 He Zhenxing	2008-09-11
      BUG#38734 rpl_server_id2 sync_with_master failed
      
      Rotate event is automatically generated and written when rotating binary
      log or relay log. Rotate events for relay logs are usually ignored by slave
      SQL thread becuase they have the same server id as that of the slave.
      However, if --replicate-same-server-id is enabled, rotate event
      for relay log would be treated as if it's a rotate event from master, and
      would be executed by slave to update the rli->group_master_log_name and
      rli->group_master_log_pos to a wrong value and cause the MASTER_POS_WAIT
      function to fail and return NULL.
      
      This patch fixed this problem by setting a flag bit (LOG_EVENT_RELAY_LOG_F)
      in the event to tell the SQL thread to ignore these Rotate events generated
      for relay logs.
      
      This patch also added another binlog event flag bit (LOG_EVENT_ARTIFICIAL_F)
      to distinquish faked events, the method used before this was by checking if
      log_pos was zero.
[15 Sep 2008 11: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/54078

2680 Andrei Elkin	2008-09-15
      Bug#38934 slave slave until does not work with --replicate-same-server-id
      
      Slave did not perform any event recorded into the relay log from some different master
      when it was started with --replicate-same-server-id.
      The reason appeared to be a consequence of BUG#38734 which stopped the sql thread at its
      startup time.
      
      The real fixes for the current bug are in the patch for BUG#38734. This changeset carries only
      a regression test for the bugs.
[30 Sep 2008 13:24] 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/54769

2696 He Zhenxing	2008-09-28 [merge]
      Merge BUG#38734 5.1-rpl -> 6.0-rpl
[30 Sep 2008 13:24] 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/54770

2696 He Zhenxing	2008-09-28 [merge]
      Merge BUG#38734 5.1-rpl -> 6.0-rpl
[30 Sep 2008 13:24] 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/54771

2696 He Zhenxing	2008-09-28 [merge]
      Merge BUG#38734 5.1-rpl -> 6.0-rpl
[30 Sep 2008 13:24] 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/54772

2666 He Zhenxing	2008-09-28
      BUG#38734 rpl_server_id2 sync_with_master failed
      
      Rotate event is automatically generated and written when rotating binary
      log or relay log. Rotate events for relay logs are usually ignored by slave
      SQL thread becuase they have the same server id as that of the slave.
      However, if --replicate-same-server-id is enabled, rotate event
      for relay log would be treated as if it's a rotate event from master, and
      would be executed by slave to update the rli->group_master_log_name and
      rli->group_master_log_pos to a wrong value and cause the MASTER_POS_WAIT
      function to fail and return NULL.
      
      This patch fixed this problem by setting a flag bit (LOG_EVENT_RELAY_LOG_F)
      in the event to tell the SQL thread to ignore these Rotate events generated
      for relay logs.
      
      This patch also added another binlog event flag bit (LOG_EVENT_ARTIFICIAL_F)
      to distinquish faked events, the method used before this was by checking if
      log_pos was zero.
[10 Dec 2008 13:02] 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/61208

2705 Andrei Elkin	2008-12-10
      Bug#38934 slave slave until does not work with --replicate-same-server-id
      Bug#38540 rpl_server_id2 uses show slave status unnecessarily
      
      Slave did not perform any event recorded into the relay log from some different master
      when it was started with --replicate-same-server-id.
      The reason appeared to be a consequence of BUG#38734 which stopped the sql thread at its
      startup time.
      
      The real fixes for the current bug are in the patch for BUG#38734.
      This changeset carries only a regression test for the bugs.
      Bug#38540 gets fixed too by means of eliminating an extra show slave status.
[10 Dec 2008 13:08] Andrei Elkin
due to a bug in parsing bzr-commit header the changeset landed on the auxiliary bug territory (needs investigation why).

The cset belongs to bug#38540 Bug #38934.
[30 Jan 2009 13:31] Bugs System
Pushed into 6.0.10-alpha (revid:luis.soares@sun.com-20090129165607-wiskabxm948yx463) (version source revid:luis.soares@sun.com-20090129163120-e2ntks4wgpqde6zt) (merge vers: 6.0.10-alpha) (pib:6)
[30 Jan 2009 15:10] Bugs System
Pushed into 5.1.32 (revid:luis.soares@sun.com-20090129165946-d6jnnfqfokuzr09y) (version source revid:hezx@mysql.com-20080928073425-suxro26cvk2wrg7m) (merge vers: 5.1.28) (pib:6)
[2 Feb 2009 15:35] Jon Stephens
Documented bugfix in the 5.1.32 and 6.0.10 changelogs as follows:

        START SLAVE UNTIL did not work correctly with
        --replicate-same-server-id enabled; when started with this
        option, the slave did not perform events recorded in the relay
        log and that originated from a different master.

        Log rotation events are automatically generated and written when
        rotating the binary log or relay log. Such events for relay logs
        are usually ignored by the slave SQL thread because they have
        the same server ID as that of the slave. However, when
        --replicate-same-server-id was enabled, the rotation event for
        the relay log was treated as if it originated on the master,
        because the log's name and position were incorrectly
        updated. This caused the MASTER_POS_WAIT() function always to
        return NULL and thus to fail.
[17 Feb 2009 15:00] Bugs System
Pushed into 5.1.32-ndb-6.3.23 (revid:tomas.ulin@sun.com-20090217131017-6u8qz1edkjfiobef) (version source revid:tomas.ulin@sun.com-20090203133556-9rclp06ol19bmzs4) (merge vers: 5.1.32-ndb-6.3.22) (pib:6)
[17 Feb 2009 16:47] Bugs System
Pushed into 5.1.32-ndb-6.4.3 (revid:tomas.ulin@sun.com-20090217134419-5ha6xg4dpedrbmau) (version source revid:tomas.ulin@sun.com-20090203133556-9rclp06ol19bmzs4) (merge vers: 5.1.32-ndb-6.3.22) (pib:6)
[17 Feb 2009 18:23] Bugs System
Pushed into 5.1.32-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090217134216-5699eq74ws4oxa0j) (version source revid:tomas.ulin@sun.com-20090201210519-vehobc4sy3g9s38e) (merge vers: 5.1.32-ndb-6.2.17) (pib:6)