1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-20945: BACKUP UNLOCK + FTWRL assertion failure

MDEV-20945: BACKUP UNLOCK + FTWRL assertion failure | SIGSEGV in I_P_List
from MDL_context::release_lock on INSERT w/ BACKUP LOCK (on optimized
builds) | Assertion `ticket->m_duration == MDL_EXPLICIT' failed

BACKUP LOCK behavior is modified so it won't be used wrong:
- BACKUP LOCK should commit any active transactions.
- BACKUP LOCK should not be allowed in stored procedures.
- When BACKUP LOCK is active, don't allow any DDL's for that connection.
- FTWRL is forbidden on the same connection while BACKUP LOCK is active.

Reviewed-by: monty@mariadb.com
This commit is contained in:
Rinat Ibragimov
2020-10-21 23:34:36 +03:00
committed by Monty
parent ac8d205795
commit 709ba7dcae
10 changed files with 277 additions and 4 deletions

View File

@ -217,6 +217,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
thd->handler_tables_hash.records ||
thd->ull_hash.records ||
thd->global_read_lock.is_acquired() ||
thd->mdl_backup_lock ||
thd->current_backup_stage != BACKUP_FINISHED
);
@ -530,7 +531,14 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
if (thd->current_backup_stage != BACKUP_FINISHED)
{
my_error(ER_BACKUP_LOCK_IS_ACTIVE, MYF(0));
return true;
goto error;
}
/* Should not flush tables while BACKUP LOCK is active */
if (thd->mdl_backup_lock)
{
my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0));
goto error;
}
if (thd->lex->type & REFRESH_READ_LOCK)