mariadb/mysql-test/suite/perfschema/r
Dmitry Lenev 5fff906edd Fix for bug #52044 "FLUSH TABLES WITH READ LOCK and FLUSH
TABLES <list> WITH READ LOCK are incompatible".

The problem was that FLUSH TABLES <list> WITH READ LOCK
which was issued when other connection has acquired global
read lock using FLUSH TABLES WITH READ LOCK was blocked
and has to wait until global read lock is released.

This issue stemmed from the fact that FLUSH TABLES <list>
WITH READ LOCK implementation has acquired X metadata locks
on tables to be flushed. Since these locks required acquiring
of global IX lock this statement was incompatible with global
read lock.

This patch addresses problem by using SNW metadata type of
lock for tables to be flushed by FLUSH TABLES <list> WITH
READ LOCK. It is OK to acquire them without global IX lock
as long as we won't try to upgrade those locks. Since SNW
locks allow concurrent statements using same table FLUSH
TABLE <list> WITH READ LOCK now has to wait until old
versions of tables to be flushed go away after acquiring
metadata locks. Since such waiting can lead to deadlock
MDL deadlock detector was extended to take into account
waits for flush and resolve such deadlocks.

As a bonus code in open_tables() which was responsible for
waiting old versions of tables to go away was refactored.
Now when we encounter old version of table in open_table()
we don't back-off and wait for all old version to go away,
but instead wait for this particular table to be flushed.
Such approach supported by deadlock detection should reduce
number of scenarios in which FLUSH TABLES aborts concurrent
multi-statement transactions.

Note that active FLUSH TABLES <list> WITH READ LOCK still
blocks concurrent FLUSH TABLES WITH READ LOCK statement
as the former keeps tables open and thus prevents the
latter statement from doing flush.
2010-07-27 17:34:58 +04:00
..
aggregate.result Misc cleanup 2010-01-27 08:26:05 -07:00
bad_option_1.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
bad_option_2.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
binlog_mix.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
binlog_row.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
binlog_stmt.result BUG#50670: Slave stops with error code 1644 2010-04-28 14:47:49 +02:00
cnf_option.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
column_privilege.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_cond_instances.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_events_waits_current.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_events_waits_history.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_events_waits_history_long.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_ews_by_event_name.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_ews_by_instance.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_ews_by_thread_by_event_name.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_file_instances.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_fs_by_event_name.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_fs_by_instance.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_mutex_instances.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_performance_timers.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_processlist.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_rwlock_instances.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_setup_consumers.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_setup_instruments.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_setup_objects.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
ddl_setup_timers.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_cond_instances.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_events_waits_current.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_events_waits_history.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_events_waits_history_long.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_ews_by_event_name.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_ews_by_instance.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_ews_by_thread_by_event_name.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_file_instances.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_file_summary_by_event_name.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_file_summary_by_instance.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_mutex_instances.result Bug#50596 Spurious test failures in perfschema.dml_mutex_instances 2010-01-25 20:12:20 -07:00
dml_performance_timers.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_processlist.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_rwlock_instances.result Bug#50596 Spurious test failures in perfschema.dml_mutex_instances 2010-01-25 20:12:20 -07:00
dml_setup_consumers.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_setup_instruments.result Fix for bug #52044 "FLUSH TABLES WITH READ LOCK and FLUSH 2010-07-27 17:34:58 +04:00
dml_setup_objects.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
dml_setup_timers.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
func_file_io.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
func_mutex.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
global_read_lock.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
information_schema.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
misc.result Bug#52586 Misleading error message on attempt to access a P_S table using a wrong name 2010-07-15 18:50:39 -06:00
myisam_file_io.result Bug#53394 Tests: perfschema.myisam_file_io fails 2010-07-16 08:21:07 -06:00
no_threads.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
one_thread_per_con.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
pfs_upgrade.result Bug#53613: mysql_upgrade incorrectly revokes ... 2010-07-15 18:57:47 -03:00
privilege.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
query_cache.result Bug#53392 Tests: perfschema.query_cache fails 2010-07-16 08:28:19 -06:00
read_only.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
schema.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
selects.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
server_init.result Fix for bug #52044 "FLUSH TABLES WITH READ LOCK and FLUSH 2010-07-27 17:34:58 +04:00
start_server_no_cond_class.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_no_cond_inst.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_no_file_class.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_no_file_inst.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_no_mutex_class.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_no_mutex_inst.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_no_rwlock_class.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_no_rwlock_inst.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_no_thread_class.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_no_thread_inst.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_off.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
start_server_on.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
tampered_perfschema_table1.result WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
thread_cache.result Bug#54782 Performance schema per thread accounting and thread cache 2010-07-16 07:50:50 -06:00