diff options
author | Monty <monty@mariadb.org> | 2020-06-08 15:13:04 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2020-06-14 19:39:43 +0300 |
commit | 6a3b581b9051e5832d43e841b73c88df9fe90755 (patch) | |
tree | 116fd511a63aea3ba1e6fd0ab65b946bd9d7a256 /sql/sql_base.cc | |
parent | 08d475c73b0dab575940162d6181187367368974 (diff) | |
download | mariadb-git-6a3b581b9051e5832d43e841b73c88df9fe90755.tar.gz |
MDEV-19745 BACKUP STAGE BLOCK_DDL hangs on flush sequence table
Problem was that FLUSH TABLES where trying to read latest sequence state
which conflicted with a running ALTER SEQUENCE. Removed the reading
of the state, when opening a table for FLUSH, as it's not needed in this
case.
Other thing:
- Fixed a potential issue with concurrently running ALTER SEQUENCE where
the later ALTER could potentially read old data
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 090ced59f60..d7be718b1ca 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -598,12 +598,15 @@ bool flush_tables(THD *thd, flush_tables_type flag) else { /* - HA_OPEN_FOR_ALTER is used to allow us to open the table even if - TABLE_SHARE::incompatible_version is set. + HA_OPEN_FOR_FLUSH is used to allow us to open the table even if + TABLE_SHARE::incompatible_version is set. It also will tell + SEQUENCE engine that we don't have to read the sequence information + (which may cause deadlocks with concurrently running ALTER TABLE or + ALTER SEQUENCE) as we will close the table at once. */ if (!open_table_from_share(thd, share, &empty_clex_str, HA_OPEN_KEYFILE, 0, - HA_OPEN_FOR_ALTER, + HA_OPEN_FOR_ALTER | HA_OPEN_FOR_FLUSH, tmp_table, FALSE, NULL)) { |