mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Fixed deadlock in main.flush_read_lock
local_global_read_lock did release all HANDLER's before taking its
MDL_BACKUP_FTWRL# locks. This had a potential race condition if
there was a waiting LOCK TABLE for one of the freed handlers.
Fixed by moving the release of HANDLER's to after the backup locks are
taken.
After commit 8cf7e3459 it's not anymore critical to free HANDLER's in
FTWRL, but we will keep the mysql_ha_cleanup_no_free() call until 10.5
to not cause any issues with 10.4 just before it's going GA.
This commit is contained in:
@@ -1034,8 +1034,6 @@ bool Global_read_lock::lock_global_read_lock(THD *thd)
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
mysql_ha_cleanup_no_free(thd);
|
||||
|
||||
DBUG_ASSERT(! thd->mdl_context.is_lock_owner(MDL_key::BACKUP, "", "",
|
||||
MDL_BACKUP_FTWRL1));
|
||||
DBUG_ASSERT(! thd->mdl_context.is_lock_owner(MDL_key::BACKUP, "", "",
|
||||
@@ -1057,6 +1055,9 @@ bool Global_read_lock::lock_global_read_lock(THD *thd)
|
||||
|
||||
m_mdl_global_read_lock= mdl_request.ticket;
|
||||
m_state= GRL_ACQUIRED;
|
||||
|
||||
/* Release HANDLER OPEN after we have got our MDL lock */
|
||||
mysql_ha_cleanup_no_free(thd);
|
||||
}
|
||||
/*
|
||||
We DON'T set global_read_lock_blocks_commit now, it will be set after
|
||||
|
||||
Reference in New Issue
Block a user