#At file:///work/bzr/mysql-5.1-39484/
2754 Horst Hunger 2009-02-19
2. fix for bug#39484: I resetted the timeout values of get_lock as they have no influence on the actual bug. Due to bug#32782 I added NULL as value to the release_lock as being successful.
I also replaced the first 2 "sleep 1" by wait conditions. the last 2 sleeps have not been replaced as I have not found a proper condition leading to deterministic results. All is described in comments.
modified:
mysql-test/include/concurrent.inc
mysql-test/r/concurrent_innodb_safelog.result
=== modified file 'mysql-test/include/concurrent.inc'
--- a/mysql-test/include/concurrent.inc 2009-01-31 18:09:41 +0000
+++ b/mysql-test/include/concurrent.inc 2009-02-19 19:02:35 +0000
@@ -11,6 +11,11 @@
# $engine_type storage engine to be tested
#
# Last update:
+# 2009-02-13 HH "Release_lock("hallo")" is now also successful when delivering NULL,
+# replaced two sleeps by wait_condition. The last two "sleep 1" have not been
+# replaced as all tried wait conditions leaded to nondeterministic results, especially
+# to succeeding concurrent updates. To replace the sleeps there should be some time
+# planned (or internal knowledge of the server may help).
# 2006-08-02 ML test refactored
# old name was t/innodb_concurrent.test
# main code went into include/concurrent.inc
@@ -89,10 +94,11 @@ drop table if exists t1;
--echo ** Update will cause a table scan and a new ULL will
--echo ** be created and blocked on the first row where tipo=11.
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
- sleep 1;
--echo ** connection thread1
connection thread1;
+ let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
+ --source include/wait_condition.inc
--echo ** Start new transaction for thread 1
begin;
--echo ** Update on t1 will cause a table scan which will be blocked because
@@ -111,7 +117,9 @@ drop table if exists t1;
}
--echo ** Release user level name lock from thread 1. This will cause the ULL
--echo ** on thread 2 to end its wait.
- select release_lock("hello");
+# Due to bug#32782, which proably also cause bug#39484 the success of the following
+# is also guaranteed for NULL.
+ select release_lock("hello") IN (1,NULL);
--echo ** Table is now updated with a new eta on tipo=22 for thread 1.
select * from t1;
@@ -119,7 +127,9 @@ drop table if exists t1;
connection thread2;
--echo ** Release the lock and collect result from update on thread 2
reap;
- select release_lock("hello");
+# Due to bug#32782, which proably also cause bug#39484 the success of the following
+# is also guaranteed for NULL.
+ select release_lock("hello") IN (1,NULL);
--echo ** Table should have eta updates where tipo=11 but updates made by
--echo ** thread 1 shouldn't be visible yet.
select * from t1;
@@ -183,10 +193,11 @@ drop table t1;
--echo ** This will cause a hang on the first row where tipo=1 until the
--echo ** blocking ULL is released.
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
- sleep 1;
- --echo ** connection thread1
+--echo ** connection thread1
connection thread1;
+ let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
+ --source include/wait_condition.inc
--echo ** Start transaction on thread 1
begin;
--echo ** Update on t1 will cause a table scan which will be blocked because
@@ -264,10 +275,11 @@ drop table t1;
--echo ** Update will create a table scan which creates a ULL where a=2;
--echo ** this will hang waiting on thread 1.
send update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
- sleep 1;
--echo ** connection thread1
connection thread1;
+ let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
+ --source include/wait_condition.inc
--echo ** Insert new values to t1 from thread 1; this created an implicit
--echo ** commit since there are no on-going transactions.
insert into t1 values (1,1);
@@ -534,6 +546,9 @@ drop table t1;
connection thread2;
begin;
send delete from t1 where tipo=2;
+# The sleep has not been replaced as all tried wait conditions leaded to sporadically
+# succeding update in the following thread. Also the used status variables '%lock%' and
+# 'innodb_deleted_rows' and infos in processlist where not sucessful.
sleep 1;
--echo ** connection thread1
@@ -594,8 +609,11 @@ drop table t1;
connection thread2;
begin;
send delete from t1 where tipo=2;
+# The sleep has not been replaced as all tried wait conditions leaded to sporadically
+# succeding update in the following thread. Also the used status variables '%lock%' and
+# 'innodb_deleted_rows' and infos in processlist where not sucessful.
sleep 1;
-
+
--echo ** connection thread1
connection thread1;
begin;
=== modified file 'mysql-test/r/concurrent_innodb_safelog.result'
--- a/mysql-test/r/concurrent_innodb_safelog.result 2009-01-31 18:09:41 +0000
+++ b/mysql-test/r/concurrent_innodb_safelog.result 2009-02-19 19:02:35 +0000
@@ -51,8 +51,8 @@ update t1 set eta=2 where tipo=22;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
** Release user level name lock from thread 1. This will cause the ULL
** on thread 2 to end its wait.
-select release_lock("hello");
-release_lock("hello")
+select release_lock("hello") IN (1,NULL);
+release_lock("hello") IN (1,NULL)
1
** Table is now updated with a new eta on tipo=22 for thread 1.
select * from t1;
@@ -70,8 +70,8 @@ eta tipo c
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
** connection thread2
** Release the lock and collect result from update on thread 2
-select release_lock("hello");
-release_lock("hello")
+select release_lock("hello") IN (1,NULL);
+release_lock("hello") IN (1,NULL)
1
** Table should have eta updates where tipo=11 but updates made by
** thread 1 shouldn't be visible yet.
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (horst:2754) Bug#32782, Bug#39484 | Horst Hunger | 19 Feb |