Bug #39854 events_scheduling fails sporadically on pushbuild
Submitted: 4 Oct 2008 10:21 Modified: 21 Jan 2009 16:18
Reporter: Sven Sandberg Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Server Severity:S7 (Test Cases)
Version:5.1, 6.0 OS:Any
Assigned to: Matthias Leich CPU Architecture:Any
Tags: events_scheduling, pushbuild, sporadic, test failure
Triage: Triaged: D3 (Medium)

[4 Oct 2008 10:21] Sven Sandberg
Description:
events_scheduling fails sporadically on pushbuild with the following result mismatch:

main.events_scheduling         [ fail ]

CURRENT_TEST: main.events_scheduling
--- C:/cygwin/home/pushbuild/pb1/pb/mysql-5.1-maint2/51/mysql-5.1.25-rc-pb51/mysql-test/r/events_scheduling.result	2008-04-27 20:17:37.000000000 +0300
+++ C:\cygwin\home\pushbuild\pb1\pb\mysql-5.1-maint2\51\mysql-5.1.25-rc-pb51\mysql-test\r\events_scheduling.reject	2008-04-27 20:50:53.640625000 +0300
@@ -64,9 +64,10 @@
 SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
 IF(SUM(a) >= 4, 'OK', 'ERROR')
 OK
+Timeout in wait_condition.inc for SELECT SUM(a) >= 5 FROM table_2
 SELECT IF(SUM(a) >= 5, 'OK', 'ERROR') FROM table_2;
 IF(SUM(a) >= 5, 'OK', 'ERROR')
-OK
+ERROR
 SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3;
 IF(SUM(a) >= 1, 'OK', 'ERROR')
 OK

mysqltest: Result content mismatch 

Retrying test, attempt(1/3)...

It's probably a race in the test case since it happens in a test for events, happens sporadically, and happens on slow servers.

How to repeat:
https://intranet.mysql.com/secure/pushbuild/showpush.pl?dir=bzr_mysql-5.1-rpl&order=48 pb-valgrind/ps_row

See also xref: http://tinyurl.com/54f6m5
[21 Nov 2008 21:28] 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/59594

2710 Matthias Leich	2008-11-21
      - Fix for Bug#39854 events_scheduling fails sporadically on pushbuild
      - restore original state of event_scheduler at the end of the test
      - minor fixes around comments, formatting
[24 Nov 2008 15:40] Patrick Crews
Ok to push.
[26 Nov 2008 16:02] Matthias Leich
Pushed to
6.0-bugteam
5.1-bugteam
[8 Dec 2008 10:19] Bugs System
Pushed into 5.1.31  (revid:matthias.leich@sun.com-20081121212823-jr29h5acdprlaa3l) (version source revid:patrick.crews@sun.com-20081126215253-rub0b9ykdsgx9fvl) (pib:5)
[8 Dec 2008 11:30] Bugs System
Pushed into 6.0.9-alpha  (revid:matthias.leich@sun.com-20081121212823-jr29h5acdprlaa3l) (version source revid:satya.bn@sun.com-20081126062555-dw4wp7jun7hoysdb) (pib:5)
[8 Dec 2008 13:09] Paul Dubois
Test case changes. No changelog entry needed.
[8 Dec 2008 18:25] Matthias Leich
The previous fix reduced the likelihood of the reported
bad effect.
Unfortunately I was a bit too optimistic:
bzr_mysql-6.0-bugteam,2008-12-05 11:29:00,vm-win2003-32-a  
--- events_scheduling.result
+++ events_scheduling.reject
@@ -65,9 +65,10 @@
 SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1;
 IF(SUM(a) >= 4, 'OK', 'ERROR')
 OK
+Timeout in wait_condition.inc for SELECT SUM(a) >= 4 FROM table_2
 SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_2;
 IF(SUM(a) >= 4, 'OK', 'ERROR')
-OK
+ERROR
 SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3;
 IF(SUM(a) >= 1, 'OK', 'ERROR')
 OK

mysqltest: Result content mismatch

It seems that we cannot expect that different events
are nearly "fair" treated by the scheduler.
It it waited till event_1 (should run every two seconds)
was 4 times executed = in minimum ~ 6 seconds passed.
We are not allowed to conclude that event_2 (should run
every second) was at least 4 times executed. 

Conclusion for MySQL 5.1/6.0:
Modify the subtest so that it does no more print the
changes caused by the executed events.
[16 Dec 2008 18:08] 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/61806

2714 Matthias Leich	2008-12-16
      Fix for Bug#39854 events_scheduling fails sporadically on pushbuild
      Detail:
      - Choose the solution that was already in place (before last fix)
        for 6.0
      - minor cleanup in comments
[17 Dec 2008 14:27] Patrick Crews
Ok to push.

Ran 2000 times on machine with varying loads w/o failure.
[19 Dec 2008 20:43] Matthias Leich
Pushed to
mysql-5.1-bugteam
mysql-6.0-bugteam
[15 Jan 2009 6:33] Bugs System
Pushed into 5.1.31 (revid:joro@sun.com-20090115053147-tx1oapthnzgvs1ro) (version source revid:azundris@mysql.com-20081230114838-cn52tu180wcrvh0h) (merge vers: 5.1.31) (pib:6)
[16 Jan 2009 3:41] Paul Dubois
Test case changes. No changelog entry needed.

Setting report to NDI pending push into 6.0.x.
[19 Jan 2009 11:26] Bugs System
Pushed into 5.1.31-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090119095303-uwwvxiibtr38djii) (version source revid:tomas.ulin@sun.com-20090115073240-1wanl85vlvw2she1) (merge vers: 5.1.31-ndb-6.2.17) (pib:6)
[19 Jan 2009 13:04] Bugs System
Pushed into 5.1.31-ndb-6.3.21 (revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (version source revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (merge vers: 5.1.31-ndb-6.3.21) (pib:6)
[19 Jan 2009 15:53] Jon Stephens
Setting status back to NDI pending merge to 6.0 tree.
[19 Jan 2009 16:10] Bugs System
Pushed into 5.1.31-ndb-6.4.1 (revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (version source revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (merge vers: 5.1.31-ndb-6.4.1) (pib:6)
[20 Jan 2009 18:56] Bugs System
Pushed into 6.0.10-alpha (revid:joro@sun.com-20090119171328-2hemf2ndc1dxl0et) (version source revid:azundris@mysql.com-20081230114916-c290n83z25wkt6e4) (merge vers: 6.0.9-alpha) (pib:6)
[21 Jan 2009 16:18] Paul Dubois
Test case changes. No changelog entry needed.