From 6695c6f1e9dd9e2623f8259e841edbfa95b012af Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 May 2011 08:16:49 +0200 Subject: [PATCH] Fix race in testcase innodb_plugin.group_commit_no_optimize_thread The problem was that connection con5, which is supposed to be the leader for the third group, could if timing was bad end up as participant in the second group, causing the test to fail. Fixed by ensuring that group 2 is running before starting the transaction for group 3. --- .../innodb_plugin/r/group_commit_no_optimize_thread.result | 2 ++ .../suite/innodb_plugin/t/group_commit_no_optimize_thread.test | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mysql-test/suite/innodb_plugin/r/group_commit_no_optimize_thread.result b/mysql-test/suite/innodb_plugin/r/group_commit_no_optimize_thread.result index 7c2636fb472..34a638da2d5 100644 --- a/mysql-test/suite/innodb_plugin/r/group_commit_no_optimize_thread.result +++ b/mysql-test/suite/innodb_plugin/r/group_commit_no_optimize_thread.result @@ -7,6 +7,7 @@ SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group1_running WAI INSERT INTO t1 VALUES ("con1"); set DEBUG_SYNC= "now WAIT_FOR group1_running"; SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con2"; +SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group2_running"; SET DEBUG_SYNC= "commit_after_release_LOCK_log WAIT_FOR group3_committed"; INSERT INTO t1 VALUES ("con2"); SET DEBUG_SYNC= "now WAIT_FOR group2_con2"; @@ -26,6 +27,7 @@ a con1 SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group3_con5"; SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con5_leader WAIT_FOR con6_queued"; +set DEBUG_SYNC= "now WAIT_FOR group2_running"; INSERT INTO t1 VALUES ("con5"); SET DEBUG_SYNC= "now WAIT_FOR con5_leader"; SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL con6_queued"; diff --git a/mysql-test/suite/innodb_plugin/t/group_commit_no_optimize_thread.test b/mysql-test/suite/innodb_plugin/t/group_commit_no_optimize_thread.test index ae3f1b516d4..a216cbd2965 100644 --- a/mysql-test/suite/innodb_plugin/t/group_commit_no_optimize_thread.test +++ b/mysql-test/suite/innodb_plugin/t/group_commit_no_optimize_thread.test @@ -37,6 +37,7 @@ send INSERT INTO t1 VALUES ("con1"); connection con2; set DEBUG_SYNC= "now WAIT_FOR group1_running"; SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con2"; +SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group2_running"; SET DEBUG_SYNC= "commit_after_release_LOCK_log WAIT_FOR group3_committed"; send INSERT INTO t1 VALUES ("con2"); connection con3; @@ -70,6 +71,7 @@ SELECT * FROM t1 ORDER BY a; connection con5; SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL group3_con5"; SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con5_leader WAIT_FOR con6_queued"; +set DEBUG_SYNC= "now WAIT_FOR group2_running"; send INSERT INTO t1 VALUES ("con5"); connection con6;