From: Dmitry Lenev Date: October 26 2010 6:53pm Subject: bzr push into mysql-5.5-runtime branch (Dmitry.Lenev:3182 to 3183) List-Archive: http://lists.mysql.com/commits/121964 Message-Id: <20101026185306.E4C4D2F0E23@mockturtle> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3183 Dmitry Lenev 2010-10-26 More changes to draft patch refactoring global read lock implementation. Makes GRL yet another type of metadata lock and thus exposes it to deadlock detector in MDL subsystem. Solves bugs #54673 "It takes too long to get readlock for 'FLUSH TABLES WITH READ LOCK'" and #57006 "Deadlock between HANDLER and FLUSH TABLES WITH READ LOCK". Work-in-progress. Add separate thread state name for waiting on commit blocker lock. modified: mysql-test/include/check_ftwrl_incompatible.inc mysql-test/t/flush_block_commit.test mysql-test/t/flush_read_lock.test mysql-test/t/flush_read_lock_kill.test sql/mdl.cc 3182 Dmitry Lenev 2010-10-26 More changes to draft patch refactoring global read lock implementation. Makes GRL yet another type of metadata lock and thus exposes it to deadlock detector in MDL subsystem. Solves bugs #54673 "It takes too long to get readlock for 'FLUSH TABLES WITH READ LOCK'" and #57006 "Deadlock between HANDLER and FLUSH TABLES WITH READ LOCK". Work-in-progress. Extended test coverage. modified: mysql-test/r/flush_read_lock.result mysql-test/t/flush_read_lock.test === modified file 'mysql-test/include/check_ftwrl_incompatible.inc' --- a/mysql-test/include/check_ftwrl_incompatible.inc 2010-10-21 19:24:20 +0000 +++ b/mysql-test/include/check_ftwrl_incompatible.inc 2010-10-26 18:50:18 +0000 @@ -68,7 +68,8 @@ connection $con_aux1; --enable_query_log let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where (state = "Waiting for global read lock" or + state = "Waiting for commit lock") and info = "$statement"; --source include/wait_condition.inc --disable_result_log @@ -115,7 +116,8 @@ connection $con_aux2; --enable_query_log let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where (state = "Waiting for global read lock" or + state = "Waiting for commit lock") and info = "flush tables with read lock"; --source include/wait_condition.inc --disable_result_log === modified file 'mysql-test/t/flush_block_commit.test' --- a/mysql-test/t/flush_block_commit.test 2010-10-18 12:33:49 +0000 +++ b/mysql-test/t/flush_block_commit.test 2010-10-26 18:50:18 +0000 @@ -39,7 +39,7 @@ connection con2; --echo # Wait until COMMIT gets blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and info = "COMMIT"; + where state = "Waiting for commit lock" and info = "COMMIT"; --source include/wait_condition.inc --echo # Verify that 'con1' was blocked and data did not move. SELECT * FROM t1; === modified file 'mysql-test/t/flush_read_lock.test' --- a/mysql-test/t/flush_read_lock.test 2010-10-26 14:19:27 +0000 +++ b/mysql-test/t/flush_read_lock.test 2010-10-26 18:50:18 +0000 @@ -265,7 +265,7 @@ connection $con_aux1; --echo # Wait until COMMIT is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where state = "Waiting for commit lock" and info = "commit"; --source include/wait_condition.inc unlock tables; @@ -290,7 +290,7 @@ connection $con_aux2; --echo # Wait until FTWRL is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where state = "Waiting for commit lock" and info = "flush tables with read lock"; --source include/wait_condition.inc set debug_sync='now SIGNAL go'; @@ -1516,7 +1516,7 @@ connection $con_aux1; --echo # Wait until SET AUTOCOMMIT=1 is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where state = "Waiting for commit lock" and info = "set autocommit= 1"; --source include/wait_condition.inc unlock tables; @@ -1541,7 +1541,7 @@ connection $con_aux2; --echo # Wait until FTWRL is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where state = "Waiting for commit lock" and info = "flush tables with read lock"; --source include/wait_condition.inc set debug_sync='now SIGNAL go'; @@ -1734,7 +1734,7 @@ connection $con_aux1; --echo # Wait until XA COMMIT is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where state = "Waiting for commit lock" and info = "xa commit 'test1'"; --source include/wait_condition.inc unlock tables; @@ -1761,7 +1761,7 @@ connection $con_aux2; --echo # Wait until FTWRL is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where state = "Waiting for commit lock" and info = "flush tables with read lock"; --source include/wait_condition.inc set debug_sync='now SIGNAL go'; @@ -1846,7 +1846,7 @@ connection $con_aux1; --echo # Check that ANALYZE TABLE is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where state = "Waiting for commit lock" and info = "analyze table t3_trans"; --source include/wait_condition.inc unlock tables; @@ -1917,7 +1917,7 @@ connection $con_aux1; --echo # Check that ALTER TABLE is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where state = "Waiting for commit lock" and info = "alter table t3_temp_trans drop column c1"; --source include/wait_condition.inc unlock tables; @@ -1950,7 +1950,7 @@ connection $con_aux1; --echo # Check that CHECK TABLE is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where state = "Waiting for commit lock" and info = "check table t1_base"; --source include/wait_condition.inc unlock tables; @@ -1972,7 +1972,7 @@ connection $con_aux1; --echo # Check that ALTER TABLE is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" and + where state = "Waiting for commit lock" and info = "alter table t1_temp add column c1 int"; --source include/wait_condition.inc unlock tables; === modified file 'mysql-test/t/flush_read_lock_kill.test' --- a/mysql-test/t/flush_read_lock_kill.test 2010-10-18 12:33:49 +0000 +++ b/mysql-test/t/flush_read_lock_kill.test 2010-10-26 18:50:18 +0000 @@ -54,7 +54,7 @@ SELECT ((@id := kill_id) - kill_id) FROM --echo # to active COMMIT let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for global read lock" + where state = "Waiting for commit lock" and info = "flush tables with read lock"; --source include/wait_condition.inc === modified file 'sql/mdl.cc' --- a/sql/mdl.cc 2010-10-25 15:16:12 +0000 +++ b/sql/mdl.cc 2010-10-26 18:50:18 +0000 @@ -85,7 +85,7 @@ const char *MDL_key::m_namespace_to_wait "Waiting for stored procedure metadata lock", "Waiting for trigger metadata lock", "Waiting for event metadata lock", - "Waiting for global read lock" + "Waiting for commit lock" }; static bool mdl_initialized= 0; No bundle (reason: useless for push emails).