diff options
-rw-r--r-- | storage/innobase/row/row0purge.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index 4588c1d2b0a..35dd06a03e8 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -1027,10 +1027,21 @@ row_purge_parse_undo_rec( try_again: purge_sys.check_stop_FTS(); - - node->table = dict_table_open_on_id( - table_id, false, DICT_TABLE_OP_NORMAL, node->purge_thd, - &node->mdl_ticket); + /* FIXME: We are acquiring exclusive dict_sys.latch only to + avoid increased wait times in + trx_purge_get_next_rec() and trx_purge_truncate_history(). */ + dict_sys.lock(SRW_LOCK_CALL); + node->table = dict_table_open_on_id(table_id, true, + DICT_TABLE_OP_NORMAL); + dict_sys.unlock(); + + if (node->table) { + dict_sys.freeze(SRW_LOCK_CALL); + node->table = dict_acquire_mdl_shared<false>( + node->table, node->purge_thd, &node->mdl_ticket, + DICT_TABLE_OP_NORMAL); + dict_sys.unfreeze(SRW_LOCK_CALL); + } if (!node->table) { /* The table has been dropped: no need to do purge and |