diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2018-10-30 02:00:46 +0400 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-12-09 22:12:26 +0200 |
commit | f1867505a62bf3ecde6438cc8d3b9cae24dd5f52 (patch) | |
tree | 081c1c7ff26f094a999fa9d702e0ab5a28a73742 /sql/mdl.h | |
parent | 7a9dfdd8d985040778881fe815cfca019fdd37f1 (diff) | |
download | mariadb-git-f1867505a62bf3ecde6438cc8d3b9cae24dd5f52.tar.gz |
Acquire global read lock (MDL_BACKUP_STMT) after share is acquired
Part of MDEV-5336 Implement LOCK FOR BACKUP
FLUSH TABLE table_names have changed slighty as we are now opening
tables before taking the MDL lock. The difference is that FLUSH TABLE
table_name will now be blocked by a table that is waiting for FTWRL.
There should not be any new deadlocks as part of this change.
The end result is still better in most cases as FTWRL is now only
waiting for write statements to end, not for read only statements and
it's not flushing tables in use from the table cache.
Share will be needed to be able to determine if table supports online
backup. Appropriate metadata lock type in BACKUP namespace will be
acquired basing on this information.
Also made pending global read lock request to be preferred victim of MDL
deadlock detector. This allows us to hide some non-fatal deadlocks and
make FTWRL less likely to break concurrent queries.
Diffstat (limited to 'sql/mdl.h')
-rw-r--r-- | sql/mdl.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/mdl.h b/sql/mdl.h index 6b615b2192d..425c7a43ea6 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -591,7 +591,8 @@ public: enum enum_deadlock_weight { - DEADLOCK_WEIGHT_DML= 0, + DEADLOCK_WEIGHT_FTWRL1= 0, + DEADLOCK_WEIGHT_DML= 1, DEADLOCK_WEIGHT_DDL= 100 }; /* A helper used to determine which lock request should be aborted. */ |