summaryrefslogtreecommitdiff
path: root/storage/innobase/include
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-20 09:18:41 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-24 15:43:10 +0200
commit06ef5509d0be2ed8197a981e2b9ceb8ac2bab0cc (patch)
tree7f7be0f04b704c20aa61460d39375ce76d5a7c6a /storage/innobase/include
parent63dd2a97e4d12ee8000e7176b5b98543c079fee8 (diff)
downloadmariadb-git-06ef5509d0be2ed8197a981e2b9ceb8ac2bab0cc.tar.gz
MDEV-24167: Replace trx_purge_latch
Diffstat (limited to 'storage/innobase/include')
-rw-r--r--storage/innobase/include/sync0types.h2
-rw-r--r--storage/innobase/include/trx0purge.h14
2 files changed, 5 insertions, 11 deletions
diff --git a/storage/innobase/include/sync0types.h b/storage/innobase/include/sync0types.h
index ee54b6fffc4..a12fb88ae55 100644
--- a/storage/innobase/include/sync0types.h
+++ b/storage/innobase/include/sync0types.h
@@ -224,7 +224,6 @@ enum latch_level_t {
SYNC_RSEG_HEADER_NEW,
SYNC_NOREDO_RSEG,
SYNC_REDO_RSEG,
- SYNC_PURGE_LATCH,
SYNC_TREE_NODE,
SYNC_TREE_NODE_FROM_HASH,
SYNC_TREE_NODE_NEW,
@@ -296,7 +295,6 @@ enum latch_id_t {
LATCH_ID_FIL_SPACE,
LATCH_ID_FTS_CACHE,
LATCH_ID_FTS_CACHE_INIT,
- LATCH_ID_TRX_PURGE,
LATCH_ID_IBUF_INDEX_TREE,
LATCH_ID_INDEX_TREE,
LATCH_ID_DICT_TABLE_STATS,
diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h
index 38e9e7207a2..0aff65fd7b6 100644
--- a/storage/innobase/include/trx0purge.h
+++ b/storage/innobase/include/trx0purge.h
@@ -29,6 +29,7 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0rseg.h"
#include "que0types.h"
+#include "srw_lock.h"
#include <queue>
@@ -127,11 +128,9 @@ class purge_sys_t
{
public:
/** latch protecting view, m_enabled */
- MY_ALIGNED(CACHE_LINE_SIZE)
- mutable rw_lock_t latch;
+ MY_ALIGNED(CACHE_LINE_SIZE) mutable srw_lock latch;
private:
/** The purge will not remove undo logs which are >= this view */
- MY_ALIGNED(CACHE_LINE_SIZE)
ReadViewBase view;
/** whether purge is enabled; protected by latch and std::atomic */
std::atomic<bool> m_enabled;
@@ -249,23 +248,20 @@ public:
/** A wrapper around ReadView::changes_visible(). */
bool changes_visible(trx_id_t id, const table_name_t &name) const
{
- ut_ad(rw_lock_own(&latch, RW_LOCK_S));
return view.changes_visible(id, name);
}
/** A wrapper around ReadView::low_limit_no(). */
trx_id_t low_limit_no() const
{
-#if 0 /* Unfortunately we don't hold this assertion, see MDEV-22718. */
- ut_ad(rw_lock_own(&latch, RW_LOCK_S));
-#endif
+ /* MDEV-22718 FIXME: We are not holding latch here! */
return view.low_limit_no();
}
/** A wrapper around trx_sys_t::clone_oldest_view(). */
void clone_oldest_view()
{
- rw_lock_x_lock(&latch);
+ latch.wr_lock();
trx_sys.clone_oldest_view(&view);
- rw_lock_x_unlock(&latch);
+ latch.wr_unlock();
}
};