From: Dmitry Lenev Date: October 25 2010 6:12pm Subject: bzr push into mysql-5.5-runtime branch (Dmitry.Lenev:3178 to 3179) List-Archive: http://lists.mysql.com/commits/121856 Message-Id: <20101025181242.235681E5128@mockturtle> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3179 Dmitry Lenev 2010-10-25 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. Fix sporadical failures of perfschema.global_read_lock test. modified: mysql-test/suite/perfschema/r/func_file_io.result mysql-test/suite/perfschema/r/func_mutex.result mysql-test/suite/perfschema/r/global_read_lock.result mysql-test/suite/perfschema/t/func_file_io.test mysql-test/suite/perfschema/t/func_mutex.test mysql-test/suite/perfschema/t/global_read_lock.test sql/sql_parse.cc 3178 Konstantin Osipov 2010-10-25 Bug#54673, review comments. modified: mysql-test/r/events_2.result mysql-test/suite/perfschema/r/server_init.result mysql-test/suite/perfschema/t/server_init.test mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result mysql-test/t/events_2.test sql/event_db_repository.cc sql/events.cc sql/events.h sql/handler.cc sql/lock.cc sql/lock.h sql/mdl.cc sql/mdl.h sql/mysqld.cc sql/sp.cc sql/sql_parse.cc sql/transaction.cc === modified file 'mysql-test/suite/perfschema/r/func_file_io.result' --- a/mysql-test/suite/perfschema/r/func_file_io.result 2010-08-12 14:08:52 +0000 +++ b/mysql-test/suite/perfschema/r/func_file_io.result 2010-10-25 18:11:22 +0000 @@ -115,3 +115,4 @@ LEFT JOIN information_schema.PROCESSLIST GROUP BY i.user, h.operation HAVING BYTES > 0 ORDER BY i.user, h.operation; +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'; === modified file 'mysql-test/suite/perfschema/r/func_mutex.result' --- a/mysql-test/suite/perfschema/r/func_mutex.result 2010-01-12 01:47:27 +0000 +++ b/mysql-test/suite/perfschema/r/func_mutex.result 2010-10-25 18:11:22 +0000 @@ -110,4 +110,5 @@ WHERE (EVENT_NAME = 'wait/synch/rwlock/s SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed; test_fm2_rw_timed Success +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'; DROP TABLE t1; === modified file 'mysql-test/suite/perfschema/r/global_read_lock.result' --- a/mysql-test/suite/perfschema/r/global_read_lock.result 2010-10-18 12:33:49 +0000 +++ b/mysql-test/suite/perfschema/r/global_read_lock.result 2010-10-25 18:11:22 +0000 @@ -1,4 +1,5 @@ use performance_schema; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost; flush privileges; connect (con1, localhost, pfsuser, , test); === modified file 'mysql-test/suite/perfschema/t/func_file_io.test' --- a/mysql-test/suite/perfschema/t/func_file_io.test 2010-08-12 14:08:52 +0000 +++ b/mysql-test/suite/perfschema/t/func_file_io.test 2010-10-25 18:11:22 +0000 @@ -190,3 +190,6 @@ GROUP BY i.user, h.operation HAVING BYTES > 0 ORDER BY i.user, h.operation; --enable_result_log + +# Clean-up. +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'; === modified file 'mysql-test/suite/perfschema/t/func_mutex.test' --- a/mysql-test/suite/perfschema/t/func_mutex.test 2010-01-12 01:47:27 +0000 +++ b/mysql-test/suite/perfschema/t/func_mutex.test 2010-10-25 18:11:22 +0000 @@ -128,4 +128,6 @@ SET @after_count = (SELECT SUM(TIMER_WAI SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed; +# Clean-up. +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'; DROP TABLE t1; === modified file 'mysql-test/suite/perfschema/t/global_read_lock.test' --- a/mysql-test/suite/perfschema/t/global_read_lock.test 2010-10-18 12:33:49 +0000 +++ b/mysql-test/suite/perfschema/t/global_read_lock.test 2010-10-25 18:11:22 +0000 @@ -22,6 +22,10 @@ use performance_schema; +# Make test robust against errors in other tests. +# Ensure that instrumentation is turned on when we create new connection. +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; + grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost; flush privileges; @@ -64,15 +68,6 @@ let $wait_condition= select 1 from perfo --source include/wait_condition.inc -if (!$success) -{ -select * from performance_schema.EVENTS_WAITS_CURRENT; -show status like '%perf%'; -show processlist; -select * from performance_schema.THREADS; -set session debug="+d,execute_command_crash"; -} - # Observe the blocked thread in the performance schema :) select event_name, left(source, locate(":", source)) as short_source, === modified file 'sql/sql_parse.cc' --- a/sql/sql_parse.cc 2010-10-25 15:16:12 +0000 +++ b/sql/sql_parse.cc 2010-10-25 18:11:22 +0000 @@ -4334,8 +4334,6 @@ finish: DEBUG_SYNC(thd, "execute_command_after_close_tables"); #endif - DBUG_EVALUATE_IF("execute_command_crash", (abort(), 0), 0); - /* It is time to release metadata lock protecting against global read lock if it is one of statements which require explicit protection. No bundle (reason: useless for push emails).