Bug #39862 concurrent_insert_func fails sporadically on pushbuild
Submitted: 4 Oct 2008 14:47 Modified: 13 Apr 2009 15:18
Reporter: Sven Sandberg Email Updates:
Status: Closed Impact on me:
None 
Category:Tests Severity:S7 (Test Cases)
Version:5.1 OS:Any
Assigned to: Horst Hunger CPU Architecture:Any
Tags: 5.1-rpl-green, concurrent_insert_func, pushbuild, race, sporadic, test failure

[4 Oct 2008 14:47] Sven Sandberg
Description:
concurrent_insert_func fails sporadically on pushbuild:

main.concurrent_insert_func              [ fail ]

CURRENT_TEST: main.concurrent_insert_func
--- /data0/pushbuild/pb2/pb/bzr_mysql-5.1-rpl/55/mysql-5.1.30-pb55/mysql-test/r/concurrent_insert_func.result	2008-09-12 00:02:22.000000000 +0300
+++ /data0/pushbuild/pb2/pb/bzr_mysql-5.1-rpl/55/mysql-5.1.30-pb55/mysql-test/r/concurrent_insert_func.reject	2008-09-12 01:29:37.054420188 +0300
@@ -62,7 +62,6 @@
 Record_7
 Record_3
 Record_4
-Record_6
 connection default;
 '#--------------------FN_DYNVARS_018_03-------------------------#'
 ## lock table and connect with connection1 ##

mysqltest: Result content mismatch

 - saving '/dev/shm/var-n_mix-110/2/log/main.concurrent_insert_func/' to '/dev/shm/var-n_mix-110/log/main.concurrent_insert_func/'

How to repeat:
https://intranet.mysql.com/secure/pushbuild/showpush.pl?dir=bzr_mysql-5.1-rpl&order=55 debx86-b/n_mix

xref: http://tinyurl.com/4rlle2

Suggested fix:
The reason is that the test uses concurrent_insert=1, makes an INSERT into t1 in connection 'default', and then SELECTs from t1 in connection 'test_con'. With concurrent_insert, the server sends 'ack' before the rows are visible to other clients, so there is a race between the INSERT and the SELECT here.

The fix is to insert something like this just after "connection test_con":

let $wait_condition= "SELECT COUNT(*) > something FROM t1";
source include/wait_condition.inc;

That will make the "test_con" client wait until the rows inserted in the "default" client become visible.
[23 Feb 2009 13: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/67192

2812 Horst Hunger	2009-02-23
      Fix for bug#39862: Inserted a wait condition after the insert of record_6, so that the next session will only be started when the insert is ready (or timeout).
[4 Mar 2009 17:29] Patrick Crews
Ok to push.
[19 Mar 2009 11:21] 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/69753

2816 Horst Hunger	2009-03-19
      Reviewed patch for Bug#39862.
[27 Mar 2009 14:57] Bugs System
Pushed into 5.1.34 (revid:joro@sun.com-20090327143448-wuuuycetc562ty6o) (version source revid:horst@mysql.com-20090319112138-afln02i0mtufzpzx) (merge vers: 5.1.34) (pib:6)
[27 Mar 2009 15:19] Paul DuBois
Test case changes. No changelog entry needed.

Setting report to NDI pending push into 6.0.x.
[13 Apr 2009 9:21] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090413084402-snnrocwzktcl88ny) (version source revid:horst@mysql.com-20090319112514-95yxq4r4zca6mj1b) (merge vers: 6.0.11-alpha) (pib:6)
[13 Apr 2009 15:18] Paul DuBois
Test case changes. No changelog entry needed.
[9 May 2009 16:44] Bugs System
Pushed into 5.1.34-ndb-6.2.18 (revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (version source revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (merge vers: 5.1.34-ndb-6.2.18) (pib:6)
[9 May 2009 17:41] Bugs System
Pushed into 5.1.34-ndb-6.3.25 (revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (version source revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (merge vers: 5.1.34-ndb-6.3.25) (pib:6)
[9 May 2009 18:39] Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (version source revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (merge vers: 5.1.34-ndb-7.0.6) (pib:6)