Bug #58160 Incorrect behaviour of rpl_change_master
Submitted: 12 Nov 2010 11:33 Modified: 13 Dec 2010 8:02
Reporter: Alexander Nozdrin Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Replication Severity:S3 (Non-critical)
Version:5.6 (Erica) OS:Any
Assigned to: Luis Soares CPU Architecture:Any
Tags: disabled

[12 Nov 2010 11:33] Alexander Nozdrin
Description:
It's all started with the "sporadic" failures of rpl_slave_status
on Windows in daily-next-mr-bugfixing:
  - Log: http://pb2.norway.sun.com/?action=archive_download&archive_id=2516739&pretty=please
  - Symptoms:
mysqltest: In included file ".\include\wait_for_slave_param.inc": At line 85: timeout in wait_for_slave_param.inc

Luis and I discussed this issue on IRC:

[14:05] <luis> alik: this should fix rpl_slave_status failure
[14:05] <luis> https://intranet.mysql.com/secure/paste/displaypaste.php?codeid=12682
[14:05] <luis> alik: the problem is that rpl_change_master was not resetting master_retry_count
[14:07] <luis> alik: thence, later in rpl_slave_status, the test waits for the IO thread to stop, but since it has large retry_count (due to rpl_change_master not cleaning itself) the IO thread it will take more than the time specified in wait_for_slave_param.inc to stop - it keeps retrying for a long time, thence the script wait script timesout 
[14:07] <luis> alik: do 
[14:07] <luis> perl mtr --mysqld=--binlog-format=row rpl_change_master rpl_slave_status
[14:08] <luis> before the patch (it will fail after approx 300 secs)
[14:08] <alik> ack
[14:08] <luis> alik: after the patch the rpl_slave_status will succeed
[14:08] <luis> alik: I think this was unnoticed before, because MTR would reorganize tests in a different way
[14:09] <luis> alik: and I think http://bugs.mysql.com/bug.php?id=57840 exposed these unclean tests issues
[14:10] <luis> alik: that should be all, sorry about those unclean tests
[14:19] <alik> luis|around: bad news. The patch helped partially: sometimes rpl_change_master failed with:
[14:19] <alik> mysqltest: At line 83: query 'CHANGE MASTER TO relay_log_file='slave-relay-bin.000005', relay_log_pos=4' failed: 1380: Failed initializing relay log position: Could not find target log during relay log initialization

How to repeat:
- Run: perl mtr --mysqld=--binlog-format=row rpl_change_master rpl_slave_status
  -> rpl_slave_status will time out

- Run: perl mtr --mysqld=--binlog-format=row rpl_change_master
  -> Ok

- Run: perl mtr --mysqld=--binlog-format=row rpl_slave_status
  -> Ok
[12 Nov 2010 11:33] Alexander Nozdrin
rpl_change_master is disabled due to this bug.
[18 Nov 2010 22:40] 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/124329

3351 Luis Soares	2010-11-18
      BUG#58160: Incorrect behaviour of rpl_chage_master
      
      rpl_change_master was not resetting the master_retry_count
      at the end of the test. Thence it would leave retry_count
      with a huge value, which could cause other tests executing
      after it to time out.
      
      We fix this by resetting the value before the 
      rpl_change_master test ends.
     @ mysql-test/suite/rpl/t/disabled.def
        Removing the entry from the list of disabled tests.
[19 Nov 2010 11:17] Luis Soares
I could not reproduce, with the above patch (which is quite close to the
original one), the following behavior:

[14:19] <alik> mysqltest: At line 83: query 'CHANGE MASTER TO
relay_log_file='slave-relay-bin.000005', relay_log_pos=4' failed: 1380: Failed
initializing relay log position: Could not find target log during relay log
initialization

I tried Windows and Linux hosts.
[25 Nov 2010 10:57] 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/125005

3393 Magnus Blåudd	2010-11-25 [merge]
      Merge patch for bug#58160 into trunk-bugfixing
[5 Dec 2010 12:40] Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (version source revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (merge vers: 5.6.1) (pib:23)
[13 Dec 2010 8:02] Jon Stephens
Issue was in test code only; no changelog entry required. Closed without further action.