diff options
author | Monty <monty@mariadb.org> | 2018-10-09 18:55:18 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-12-09 22:12:25 +0200 |
commit | 163b34fe25919b25ff83860f30f2440b44c8b53b (patch) | |
tree | 7d21575247bdba318889ad4bc650028e59549781 /mysql-test/main/mdl_sync.result | |
parent | 306b7a2243eb3c3e8dcc567ef6d4e7e50dca21a4 (diff) | |
download | mariadb-git-163b34fe25919b25ff83860f30f2440b44c8b53b.tar.gz |
Optimize flush tables with read lock (FTWRL) to not wait for select's
Part of MDEV-5336 Implement LOCK FOR BACKUP
The idea is that instead of waiting in close_cached_tables() for all
tables to be closed, we instead call flush_tables() that does:
- Flush not used objects in table cache to free memory
- Collect all tables that are open
- Call HA_EXTRA_FLUSH on the objects, to get them into "closed state"
- Added HA_EXTRA_FLUSH support to archive and CSV
- Added multi-user protection to HA_EXTRA_FLUSH in MyISAM and Aria
The benefit compared to old code is:
- FTWRL doesn't have to wait for long running read operations or
open HANDLER's
Diffstat (limited to 'mysql-test/main/mdl_sync.result')
-rw-r--r-- | mysql-test/main/mdl_sync.result | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/mysql-test/main/mdl_sync.result b/mysql-test/main/mdl_sync.result index 3880fc5ef91..bf659a3616f 100644 --- a/mysql-test/main/mdl_sync.result +++ b/mysql-test/main/mdl_sync.result @@ -3055,7 +3055,7 @@ disconnect con3; # CREATE TABLE t1(a INT) ENGINE=InnoDB; SET debug_sync='open_tables_after_open_and_process_table SIGNAL ready WAIT_FOR go'; -SELECT * FROM t1; +INSERT INTO t1 values (1); connect con1,localhost,root,,; SET debug_sync='now WAIT_FOR ready'; SET lock_wait_timeout=1; @@ -3063,7 +3063,21 @@ FLUSH TABLES WITH READ LOCK; ERROR HY000: Lock wait timeout exceeded; try restarting transaction SET debug_sync='now SIGNAL go'; connection default; +# After MDEV-5536, SELECT will not block FLUSH TABLES +SET debug_sync='RESET'; +SET debug_sync='open_tables_after_open_and_process_table SIGNAL ready WAIT_FOR go'; +SELECT * FROM t1; +connection con1; +SET debug_sync='now WAIT_FOR ready'; +SET lock_wait_timeout=1; +FLUSH TABLES WITH READ LOCK; +SET debug_sync='now SIGNAL go'; +connection default; a +1 +connection con1; +unlock tables; +connection default; SET debug_sync='RESET'; DROP TABLE t1; disconnect con1; |