summaryrefslogtreecommitdiff
path: root/storage/innobase/row/row0purge.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-11-14 11:40:33 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-11-14 11:40:33 +0200
commit3d4a80153345209bad736235d4f66dcaa51a9d51 (patch)
treed9b6b5e1fcbe8e1e96b7c02880ee25bf84a7437b /storage/innobase/row/row0purge.cc
parent4ded5fb9ac0cf94ec0d16b69acebdecc4066c5f2 (diff)
downloadmariadb-git-3d4a80153345209bad736235d4f66dcaa51a9d51.tar.gz
MDEV-12353 preparation: Replace mtr_x_lock() and friends
Apart from page latches (buf_block_t::lock), mini-transactions are keeping track of at most one dict_index_t::lock and fil_space_t::latch at a time, and in a rare case, purge_sys.latch. Let us introduce interfaces for acquiring an index latch or a tablespace latch. In a later version, we may want to introduce mtr_t members for holding a latched dict_index_t* and fil_space_t*, and replace the remaining use of mtr_t::m_memo with std::set<buf_block_t*> or with a map<buf_block_t*,byte*> pointing to log records.
Diffstat (limited to 'storage/innobase/row/row0purge.cc')
-rw-r--r--storage/innobase/row/row0purge.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index 8c83482f53e..b71f8491787 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -385,14 +385,14 @@ row_purge_remove_sec_if_poss_tree(
enum row_search_result search_result;
log_free_check();
- mtr_start(&mtr);
+ mtr.start();
index->set_modified(mtr);
if (!index->is_committed()) {
/* The index->online_status may change if the index is
or was being created online, but not committed yet. It
is protected by index->lock. */
- mtr_sx_lock(dict_index_get_lock(index), &mtr);
+ mtr_sx_lock_index(index, &mtr);
if (dict_index_is_online_ddl(index)) {
/* Online secondary index creation will not
@@ -487,9 +487,9 @@ row_purge_remove_sec_if_poss_tree(
}
func_exit:
- btr_pcur_close(&pcur);
+ btr_pcur_close(&pcur); // FIXME: need this?
func_exit_no_pcur:
- mtr_commit(&mtr);
+ mtr.commit();
return(success);
}
@@ -516,7 +516,7 @@ row_purge_remove_sec_if_poss_leaf(
log_free_check();
ut_ad(index->table == node->table);
ut_ad(!index->table->is_temporary());
- mtr_start(&mtr);
+ mtr.start();
index->set_modified(mtr);
if (!index->is_committed()) {
@@ -528,7 +528,7 @@ row_purge_remove_sec_if_poss_leaf(
/* The index->online_status may change if the the
index is or was being created online, but not
committed yet. It is protected by index->lock. */
- mtr_s_lock(dict_index_get_lock(index), &mtr);
+ mtr_s_lock_index(index, &mtr);
if (dict_index_is_online_ddl(index)) {
/* Online secondary index creation will not
@@ -632,7 +632,7 @@ row_purge_remove_sec_if_poss_leaf(
->page.id);
btr_pcur_close(&pcur);
- mtr_commit(&mtr);
+ mtr.commit();
return(success);
}
}
@@ -658,9 +658,9 @@ row_purge_remove_sec_if_poss_leaf(
/* The deletion was buffered. */
case ROW_NOT_FOUND:
/* The index entry does not exist, nothing to do. */
- btr_pcur_close(&pcur);
+ btr_pcur_close(&pcur); // FIXME: do we need these? when is btr_cur->rtr_info set?
func_exit_no_pcur:
- mtr_commit(&mtr);
+ mtr.commit();
return(success);
}
@@ -950,12 +950,12 @@ skip_secondaries:
ut_ad(rseg->id == rseg_id);
ut_ad(rseg->is_persistent());
- mtr_start(&mtr);
+ mtr.start();
/* We have to acquire an SX-latch to the clustered
index tree (exclude other tree changes) */
- mtr_sx_lock(dict_index_get_lock(index), &mtr);
+ mtr_sx_lock_index(index, &mtr);
index->set_modified(mtr);
@@ -986,7 +986,7 @@ skip_secondaries:
data_field + dfield_get_len(&ufield->new_val)
- BTR_EXTERN_FIELD_REF_SIZE,
NULL, NULL, NULL, 0, false, &mtr);
- mtr_commit(&mtr);
+ mtr.commit();
}
}