Skip to content

Commit

Permalink
MDEV-24258 fixup: Do not update dict_table_t::n_ref_count
Browse files Browse the repository at this point in the history
row_purge_remove_clust_if_poss_low(): The table identified by
SYS_INDEXES.TABLE_ID is protected by exclusive dict_sys.latch.
There is no need to touch its reference count.
  • Loading branch information
dr-m committed Sep 13, 2021
1 parent 329d370 commit f6717c4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions storage/innobase/row/row0purge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ row_purge_remove_clust_if_poss_low(
retry:
purge_sys.check_stop_FTS();
dict_sys.lock(SRW_LOCK_CALL);
table = dict_table_open_on_id(
table_id, true, DICT_TABLE_OP_OPEN_ONLY_IF_CACHED);
table = dict_sys.find_table(table_id);
if (!table) {
dict_sys.unlock();
} else if (table->n_rec_locks) {
Expand All @@ -141,7 +140,6 @@ row_purge_remove_clust_if_poss_low(
mtr.commit();
close_and_exit:
if (table) {
dict_table_close(table, true);
dict_sys.unlock();
}
return success;
Expand All @@ -166,7 +164,7 @@ row_purge_remove_clust_if_poss_low(
if (const uint32_t space_id = dict_drop_index_tree(
&node->pcur, nullptr, &mtr)) {
if (table) {
if (table->release()) {
if (table->get_ref_count() == 0) {
dict_sys.remove(table);
} else if (table->space_id == space_id) {
table->space = nullptr;
Expand All @@ -181,7 +179,6 @@ row_purge_remove_clust_if_poss_low(
mtr.commit();

if (table) {
dict_table_close(table, true);
dict_sys.unlock();
table = nullptr;
}
Expand Down

0 comments on commit f6717c4

Please sign in to comment.