Commit 4362ed1b authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-25691 fixup: Avoid MDL acquisition in purge

row_purge_remove_clust_if_poss_low(): When dict_table_open_on_id()
is being invoked with the data dictionary locked, it will not
actually acquire MDL. Remove the MDL that became dead code in
commit c366845a.
parent e94172c2
......@@ -108,7 +108,6 @@ row_purge_remove_clust_if_poss_low(
dict_index_t* index = dict_table_get_first_index(node->table);
table_id_t table_id = 0;
index_id_t index_id = 0;
MDL_ticket* mdl_ticket = nullptr;
dict_table_t *table = nullptr;
pfs_os_file_t f = OS_FILE_CLOSED;
......@@ -117,8 +116,7 @@ row_purge_remove_clust_if_poss_low(
purge_sys.check_stop_FTS();
dict_sys.mutex_lock();
table = dict_table_open_on_id(
table_id, true, DICT_TABLE_OP_OPEN_ONLY_IF_CACHED,
node->purge_thd, &mdl_ticket);
table_id, true, DICT_TABLE_OP_OPEN_ONLY_IF_CACHED);
if (!table) {
dict_sys.mutex_unlock();
} else if (table->n_rec_locks) {
......@@ -143,8 +141,7 @@ row_purge_remove_clust_if_poss_low(
mtr.commit();
close_and_exit:
if (table) {
dict_table_close(table, true, false,
node->purge_thd, mdl_ticket);
dict_table_close(table, true, false);
dict_sys.mutex_unlock();
}
return success;
......@@ -175,16 +172,8 @@ row_purge_remove_clust_if_poss_low(
table->space = nullptr;
table->file_unreadable = true;
}
table = nullptr;
dict_sys.mutex_unlock();
if (!mdl_ticket);
else if (MDL_context* mdl_context =
static_cast<MDL_context*>(
thd_mdl_context(node->
purge_thd))) {
mdl_context->release_lock(mdl_ticket);
mdl_ticket = nullptr;
}
table = nullptr;
}
f = fil_delete_tablespace(space_id);
}
......@@ -192,8 +181,7 @@ row_purge_remove_clust_if_poss_low(
mtr.commit();
if (table) {
dict_table_close(table, true, false,
node->purge_thd, mdl_ticket);
dict_table_close(table, true, false);
dict_sys.mutex_unlock();
table = nullptr;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment