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( ...@@ -108,7 +108,6 @@ row_purge_remove_clust_if_poss_low(
dict_index_t* index = dict_table_get_first_index(node->table); dict_index_t* index = dict_table_get_first_index(node->table);
table_id_t table_id = 0; table_id_t table_id = 0;
index_id_t index_id = 0; index_id_t index_id = 0;
MDL_ticket* mdl_ticket = nullptr;
dict_table_t *table = nullptr; dict_table_t *table = nullptr;
pfs_os_file_t f = OS_FILE_CLOSED; pfs_os_file_t f = OS_FILE_CLOSED;
...@@ -117,8 +116,7 @@ row_purge_remove_clust_if_poss_low( ...@@ -117,8 +116,7 @@ row_purge_remove_clust_if_poss_low(
purge_sys.check_stop_FTS(); purge_sys.check_stop_FTS();
dict_sys.mutex_lock(); dict_sys.mutex_lock();
table = dict_table_open_on_id( table = dict_table_open_on_id(
table_id, true, DICT_TABLE_OP_OPEN_ONLY_IF_CACHED, table_id, true, DICT_TABLE_OP_OPEN_ONLY_IF_CACHED);
node->purge_thd, &mdl_ticket);
if (!table) { if (!table) {
dict_sys.mutex_unlock(); dict_sys.mutex_unlock();
} else if (table->n_rec_locks) { } else if (table->n_rec_locks) {
...@@ -143,8 +141,7 @@ row_purge_remove_clust_if_poss_low( ...@@ -143,8 +141,7 @@ row_purge_remove_clust_if_poss_low(
mtr.commit(); mtr.commit();
close_and_exit: close_and_exit:
if (table) { if (table) {
dict_table_close(table, true, false, dict_table_close(table, true, false);
node->purge_thd, mdl_ticket);
dict_sys.mutex_unlock(); dict_sys.mutex_unlock();
} }
return success; return success;
...@@ -175,16 +172,8 @@ row_purge_remove_clust_if_poss_low( ...@@ -175,16 +172,8 @@ row_purge_remove_clust_if_poss_low(
table->space = nullptr; table->space = nullptr;
table->file_unreadable = true; table->file_unreadable = true;
} }
table = nullptr;
dict_sys.mutex_unlock(); dict_sys.mutex_unlock();
if (!mdl_ticket); table = nullptr;
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;
}
} }
f = fil_delete_tablespace(space_id); f = fil_delete_tablespace(space_id);
} }
...@@ -192,8 +181,7 @@ row_purge_remove_clust_if_poss_low( ...@@ -192,8 +181,7 @@ row_purge_remove_clust_if_poss_low(
mtr.commit(); mtr.commit();
if (table) { if (table) {
dict_table_close(table, true, false, dict_table_close(table, true, false);
node->purge_thd, mdl_ticket);
dict_sys.mutex_unlock(); dict_sys.mutex_unlock();
table = nullptr; 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