Bug #30209 rpl_packet.test: Slave_running mismatch (timing bug?)
Submitted: 2 Aug 2007 18:13 Modified: 28 Nov 2007 16:29
Reporter: Timothy Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.0, 5.1 OS:Any
Assigned to: Andrei Elkin CPU Architecture:Any
Tags: pbfail

[2 Aug 2007 18:13] Timothy Smith
Description:
Intermittent test failure of rpl_packet.test.  Seen in both MySQL 5.0 and 5.1.

rpl_packet                     [ fail ]

Errors are (from e:/var-n_stm-100/log/mysqltest-time) :
mysqltest: Result length mismatch
(the last lines may be the most important ones)
Below are the diffs between actual and expected results:
-------------------------------------------------------
*** r/rpl_packet.result	Fri Mar 30 12:05:30 2007
--- r/rpl_packet.reject	Fri Mar 30 12:42:45 2007
***************
*** 23,26 ****
  INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...a2048');
  SHOW STATUS LIKE 'Slave_running';
  Variable_name	Value
! Slave_running	OFF
--- 23,26 ----
  INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...a2048');
  SHOW STATUS LIKE 'Slave_running';
  Variable_name	Value
! Slave_running	ON
-------------------------------------------------------

How to repeat:
See pushbuild results, such as:

https://intranet.mysql.com/~tsmith/bugs/showpush.pl?dir=mysql-5.0&order=965
https://intranet.mysql.com/~tsmith/bugs/showpush.pl?dir=mysql-5.1&order=1492

The first failure I see is on 2007-03-30.

Suggested fix:
The culprit must be the 'sleep 2' in the test, here:

# The slave I/O thread must stop after trying to read the above event
connection slave; 
sleep 2;
SHOW STATUS LIKE 'Slave_running';
[9 Aug 2007 21:18] 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/32333

ChangeSet@1.2556, 2007-08-09 23:18:44+02:00, jmiller@mysql.com +3 -0
  rpl_packet.test:
    Updated test to use new include function
  wait_for_slave_running_off.inc:
    Created new include to resolve the timing issue recorded by Bug#30209
  rpl_events.inc:
    The issue shown in Bug#30128 is that 'from er' shows up in a part of the test that it should not show up in. This event really is not created until later in the test, yet since the test runs row and then turns around and runs statement, I am guessing that the first run may not have cleaned up like it should, so I am adding a sync with master after the drop of table t1 to ensure that both master and slave are clean.
[10 Aug 2007 22: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/32410

ChangeSet@1.2557, 2007-08-11 00:07:11+02:00, jmiller@mysql.com +2 -0
  rpl_packet.test:
    Changed patch to Mats suggestion from review. Patch is for Bug#30209
  .del-wait_for_slave_running_off.inc:
    Delete: mysql-test/include/wait_for_slave_running_off.inc
[10 Aug 2007 22:10] Jonathan Miller
Patch pushed into mysql-5.1-new-rpl team tree
[18 Aug 2007 0:15] Bugs System
Pushed into 5.1.22-beta
[28 Aug 2007 3:02] Jonathan Miller
I found that this is still failing in push build. Therefore I am marking this verified and will discuss with Lars and Mats.
/Jeb
[29 Aug 2007 16: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/33365

ChangeSet@1.2499, 2007-08-29 19:57:10+03:00, aelkin@koti.dsl.inet.fi +2 -0
  Bug #30209  	rpl_packet.test: Slave_running mismatch (timing bug?)
  
  explicit --sleep is removed in favor of wait_for_slave_io_to_stop.inc.
  The status reporting uses `SHOW SLAVE STATUS' *not* possibly buggy "SHOW STATUS LIKE 'Slave_running'".
[27 Nov 2007 10:49] Bugs System
Pushed into 5.0.54
[27 Nov 2007 10:51] Bugs System
Pushed into 5.1.23-rc
[27 Nov 2007 10:54] Bugs System
Pushed into 6.0.4-alpha
[28 Nov 2007 16:29] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Closed without further action since this is not a user-facing issue.