Fixed sporadic main.mdl_sync failure

When update finishes, MDL_context::release_transactional_locks() first
releases MDL_STATEMENT locks (MDL_BACKUP_DML and MDL_BACKUP_TRANS_DML
in this particular cases), which allows FTWRL connection to proceed.
Then MDL_TRANSACTION locks get released (MDL_SHARED_WRITE in this case).
metadata_lock_info query may sporadically hit this gap and observe
these otherwise unexpected locks.
This commit is contained in:
Sergey Vojtovich 2018-12-10 22:52:24 +04:00
commit 1c53aeff58

View file

@ -3310,7 +3310,11 @@ SET DEBUG_SYNC= 'now SIGNAL grlwait';
SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
FLUSH TABLES WITH READ LOCK;
let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info;
--source include/wait_condition.inc
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
unlock tables;
connection default;