Skip to content

Commit 1c53aef

Browse files
committed
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.
1 parent 0fcb141 commit 1c53aef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mysql-test/main/mdl_sync.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3310,7 +3310,11 @@ SET DEBUG_SYNC= 'now SIGNAL grlwait';
33103310
SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
33113311
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
33123312
FLUSH TABLES WITH READ LOCK;
3313+
3314+
let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info;
3315+
--source include/wait_condition.inc
33133316
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
3317+
33143318
unlock tables;
33153319

33163320
connection default;

0 commit comments

Comments
 (0)