summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-20 09:31:27 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-24 15:43:11 +0200
commit1a1b7a6f16c44239655aa8785647f686730e7632 (patch)
tree65065db2522909022883ba23165bee06d01bdfb4
parent06ef5509d0be2ed8197a981e2b9ceb8ac2bab0cc (diff)
downloadmariadb-git-1a1b7a6f16c44239655aa8785647f686730e7632.tar.gz
MDEV-24167: Replace dict_operation_lock (dict_sys.latch)
-rw-r--r--mysql-test/suite/perfschema/r/sxlock_func.result2
-rw-r--r--storage/innobase/dict/dict0dict.cc4
-rw-r--r--storage/innobase/dict/dict0stats_bg.cc4
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
-rw-r--r--storage/innobase/handler/handler0alter.cc2
-rw-r--r--storage/innobase/handler/i_s.cc36
-rw-r--r--storage/innobase/include/dict0dict.h57
-rw-r--r--storage/innobase/include/log0log.ic2
-rw-r--r--storage/innobase/include/row0mysql.h10
-rw-r--r--storage/innobase/include/sync0types.h4
-rw-r--r--storage/innobase/row/row0import.cc10
-rw-r--r--storage/innobase/row/row0ins.cc2
-rw-r--r--storage/innobase/row/row0log.cc1
-rw-r--r--storage/innobase/row/row0mysql.cc31
-rw-r--r--storage/innobase/row/row0umod.cc2
-rw-r--r--storage/innobase/sync/sync0debug.cc6
-rw-r--r--storage/innobase/sync/sync0rw.cc12
17 files changed, 74 insertions, 113 deletions
diff --git a/mysql-test/suite/perfschema/r/sxlock_func.result b/mysql-test/suite/perfschema/r/sxlock_func.result
index c22842aea3d..819aea5c9bb 100644
--- a/mysql-test/suite/perfschema/r/sxlock_func.result
+++ b/mysql-test/suite/perfschema/r/sxlock_func.result
@@ -7,7 +7,6 @@ TRUNCATE TABLE performance_schema.events_waits_current;
select name from performance_schema.setup_instruments
where name like "wait/synch/sxlock/%" order by name;
name
-wait/synch/sxlock/innodb/dict_operation_lock
wait/synch/sxlock/innodb/fil_space_latch
wait/synch/sxlock/innodb/fts_cache_init_rw_lock
wait/synch/sxlock/innodb/fts_cache_rw_lock
@@ -23,7 +22,6 @@ where name in
)
order by name;
name
-wait/synch/sxlock/innodb/dict_operation_lock
drop table if exists t1;
create table t1(a int) engine=innodb;
begin;
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 168636cc965..f06127f0fb8 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -1038,7 +1038,7 @@ void dict_sys_t::create()
table_id_hash.create(hash_size);
temp_id_hash.create(hash_size);
- rw_lock_create(dict_operation_lock_key, &latch, SYNC_DICT_OPERATION);
+ latch.init(dict_operation_lock_key);
if (!srv_read_only_mode)
{
@@ -4950,7 +4950,7 @@ void dict_sys_t::close()
mutex_exit(&mutex);
mutex_free(&mutex);
- rw_lock_free(&latch);
+ latch.destroy();
mutex_free(&dict_foreign_err_mutex);
diff --git a/storage/innobase/dict/dict0stats_bg.cc b/storage/innobase/dict/dict0stats_bg.cc
index bd7ae83b53a..67769647624 100644
--- a/storage/innobase/dict/dict0stats_bg.cc
+++ b/storage/innobase/dict/dict0stats_bg.cc
@@ -298,8 +298,8 @@ void dict_stats_init()
dict_stats_update_if_needed() is called and it may be acquired
inside that function (thus a level <=SYNC_DICT would do).
3) from row_drop_table_for_mysql() after dict_sys.mutex (SYNC_DICT)
- and dict_sys.latch (SYNC_DICT_OPERATION) have been locked
- (thus a level <SYNC_DICT && <SYNC_DICT_OPERATION would do)
+ and dict_sys.latch have been locked
+ (thus a level <SYNC_DICT would do)
So we choose SYNC_STATS_AUTO_RECALC to be about below SYNC_DICT. */
mutex_create(LATCH_ID_RECALC_POOL, &recalc_pool_mutex);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 9db051609d7..49d56f5048b 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -564,7 +564,7 @@ static PSI_rwlock_info all_innodb_rwlocks[] = {
# ifdef BTR_CUR_HASH_ADAPT
{ &btr_search_latch_key, "btr_search_latch", 0 },
# endif
- PSI_RWLOCK_KEY(dict_operation_lock),
+ { &dict_operation_lock_key, "dict_operation_lock", 0 },
PSI_RWLOCK_KEY(fil_space_latch),
PSI_RWLOCK_KEY(fts_cache_rw_lock),
PSI_RWLOCK_KEY(fts_cache_init_rw_lock),
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 54e467a8a50..10bf093977c 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -8312,8 +8312,6 @@ ha_innobase::inplace_alter_table(
DBUG_ENTER("inplace_alter_table");
DBUG_ASSERT(!srv_read_only_mode);
ut_ad(!sync_check_iterate(sync_check()));
- ut_ad(!rw_lock_own_flagged(&dict_sys.latch,
- RW_LOCK_FLAG_X | RW_LOCK_FLAG_S));
DEBUG_SYNC(m_user_thd, "innodb_inplace_alter_table_enter");
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index bfea5613b19..80a4099418c 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -2417,18 +2417,18 @@ i_s_fts_deleted_generic_fill(
/* Prevent DROP of the internal tables for fulltext indexes.
FIXME: acquire DDL-blocking MDL on the user table name! */
- rw_lock_s_lock(&dict_sys.latch);
+ dict_sys.freeze();
user_table = dict_table_open_on_id(
innodb_ft_aux_table_id, FALSE, DICT_TABLE_OP_NORMAL);
if (!user_table) {
- rw_lock_s_unlock(&dict_sys.latch);
+func_exit:
+ dict_sys.unfreeze();
DBUG_RETURN(0);
} else if (!dict_table_has_fts_index(user_table)) {
dict_table_close(user_table, FALSE, FALSE);
- rw_lock_s_unlock(&dict_sys.latch);
- DBUG_RETURN(0);
+ goto func_exit;
}
deleted = fts_doc_ids_create();
@@ -2444,7 +2444,7 @@ i_s_fts_deleted_generic_fill(
dict_table_close(user_table, FALSE, FALSE);
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
trx->free();
@@ -2793,14 +2793,14 @@ i_s_fts_index_cache_fill(
/* Prevent DROP of the internal tables for fulltext indexes.
FIXME: acquire DDL-blocking MDL on the user table name! */
- rw_lock_s_lock(&dict_sys.latch);
+ dict_sys.freeze();
user_table = dict_table_open_on_id(
innodb_ft_aux_table_id, FALSE, DICT_TABLE_OP_NORMAL);
if (!user_table) {
no_fts:
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
DBUG_RETURN(0);
}
@@ -2831,7 +2831,7 @@ no_fts:
rw_lock_s_unlock(&cache->lock);
dict_table_close(user_table, FALSE, FALSE);
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
DBUG_RETURN(ret);
}
@@ -3243,13 +3243,13 @@ i_s_fts_index_table_fill(
/* Prevent DROP of the internal tables for fulltext indexes.
FIXME: acquire DDL-blocking MDL on the user table name! */
- rw_lock_s_lock(&dict_sys.latch);
+ dict_sys.freeze();
user_table = dict_table_open_on_id(
innodb_ft_aux_table_id, FALSE, DICT_TABLE_OP_NORMAL);
if (!user_table) {
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
DBUG_RETURN(0);
}
@@ -3269,7 +3269,7 @@ i_s_fts_index_table_fill(
dict_table_close(user_table, FALSE, FALSE);
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
ut_free(conv_str.f_str);
@@ -3397,14 +3397,14 @@ i_s_fts_config_fill(
/* Prevent DROP of the internal tables for fulltext indexes.
FIXME: acquire DDL-blocking MDL on the user table name! */
- rw_lock_s_lock(&dict_sys.latch);
+ dict_sys.freeze();
user_table = dict_table_open_on_id(
innodb_ft_aux_table_id, FALSE, DICT_TABLE_OP_NORMAL);
if (!user_table) {
no_fts:
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
DBUG_RETURN(0);
}
@@ -3468,7 +3468,7 @@ no_fts:
dict_table_close(user_table, FALSE, FALSE);
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
trx->free();
@@ -5107,7 +5107,7 @@ i_s_sys_tables_fill_table_stats(
}
heap = mem_heap_create(1000);
- rw_lock_s_lock(&dict_sys.latch);
+ dict_sys.freeze();
mutex_enter(&dict_sys.mutex);
mtr_start(&mtr);
@@ -5141,11 +5141,11 @@ i_s_sys_tables_fill_table_stats(
err_msg);
}
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
mem_heap_empty(heap);
/* Get the next record */
- rw_lock_s_lock(&dict_sys.latch);
+ dict_sys.freeze();
mutex_enter(&dict_sys.mutex);
mtr_start(&mtr);
@@ -5154,7 +5154,7 @@ i_s_sys_tables_fill_table_stats(
mtr_commit(&mtr);
mutex_exit(&dict_sys.mutex);
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
mem_heap_free(heap);
DBUG_RETURN(0);
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index f7c4d5dca29..2d347feb7d6 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -31,6 +31,7 @@ Created 1/8/1996 Heikki Tuuri
#include "data0data.h"
#include "dict0mem.h"
#include "fsp0fsp.h"
+#include "srw_lock.h"
#include <deque>
class MDL_ticket;
@@ -1392,6 +1393,21 @@ extern ib_mutex_t dict_foreign_err_mutex; /* mutex protecting the
/** InnoDB data dictionary cache */
class dict_sys_t
{
+private:
+ /** @brief the data dictionary rw-latch protecting dict_sys
+
+ Table create, drop, etc. reserve this in X-mode (along with
+ acquiring dict_sys.mutex); implicit or
+ backround operations that are not fully covered by MDL
+ (rollback, foreign key checks) reserve this in S-mode.
+
+ This latch also prevents lock waits when accessing the InnoDB
+ data dictionary tables. @see trx_t::dict_operation_lock_mode */
+ MY_ALIGNED(CACHE_LINE_SIZE) srw_lock latch;
+#ifdef UNIV_DEBUG
+ /** whether latch is being held in exclusive mode (by any thread) */
+ bool latch_ex;
+#endif
public:
DictSysMutex mutex; /*!< mutex protecting the data
dictionary; protects also the
@@ -1400,15 +1416,6 @@ public:
and DROP TABLE, as well as reading
the dictionary data for a table from
system tables */
- /** @brief the data dictionary rw-latch protecting dict_sys
-
- Table create, drop, etc. reserve this in X-mode; implicit or
- backround operations purge, rollback, foreign key checks reserve this
- in S-mode; not all internal InnoDB operations are covered by MDL.
-
- This latch also prevents lock waits when accessing the InnoDB
- data dictionary tables. @see trx_t::dict_operation_lock_mode */
- rw_lock_t latch;
row_id_t row_id; /*!< the next row id to assign;
NOTE that at a checkpoint this
must be written to the dict system
@@ -1433,9 +1440,10 @@ public:
table_non_LRU; /*!< List of tables that can't be
evicted from the cache */
private:
- bool m_initialised;
- /** the sequence of temporary table IDs */
- std::atomic<table_id_t> temp_table_id;
+ bool m_initialised= false;
+ /** the sequence of temporary table IDs */
+ std::atomic<table_id_t> temp_table_id{DICT_HDR_FIRST_ID};
+
/** hash table of temporary table IDs */
hash_table_t temp_id_hash;
public:
@@ -1480,12 +1488,6 @@ public:
return table;
}
- /**
- Constructor. Further initialisation happens in create().
- */
-
- dict_sys_t() : m_initialised(false), temp_table_id(DICT_HDR_FIRST_ID) {}
-
bool is_initialised() const { return m_initialised; }
/** Initialise the data dictionary cache. */
@@ -1544,26 +1546,31 @@ public:
#ifdef UNIV_DEBUG
/** Assert that the data dictionary is locked */
- void assert_locked()
- {
- ut_ad(mutex_own(&mutex));
- ut_ad(rw_lock_own(&latch, RW_LOCK_X));
- }
+ void assert_locked() { ut_ad(mutex_own(&mutex)); }
#endif
/** Lock the data dictionary cache. */
void lock(const char* file, unsigned line)
{
- rw_lock_x_lock_func(&latch, 0, file, line);
+ latch.wr_lock();
+ ut_ad(!latch_ex);
+ ut_d(latch_ex= true);
mutex_enter_loc(&mutex, file, line);
}
/** Unlock the data dictionary cache. */
void unlock()
{
+ ut_ad(latch_ex);
+ ut_d(latch_ex= false);
mutex_exit(&mutex);
- rw_lock_x_unlock(&latch);
+ latch.wr_unlock();
}
+ /** Prevent modifications of the data dictionary */
+ void freeze() { latch.rd_lock(); ut_ad(!latch_ex); }
+ /** Allow modifications of the data dictionary */
+ void unfreeze() { ut_ad(!latch_ex); latch.rd_unlock(); }
+
/** Estimate the used memory occupied by the data dictionary
table and index objects.
@return number of bytes occupied */
diff --git a/storage/innobase/include/log0log.ic b/storage/innobase/include/log0log.ic
index d503e3ffec9..3af021ee9df 100644
--- a/storage/innobase/include/log0log.ic
+++ b/storage/innobase/include/log0log.ic
@@ -308,8 +308,6 @@ log_free_check(void)
static const latch_level_t latches[] = {
SYNC_DICT, /* dict_sys.mutex during
commit_try_rebuild() */
- SYNC_DICT_OPERATION, /* dict_sys.latch X-latch during
- commit_try_rebuild() */
SYNC_FTS_CACHE, /* fts_cache_t::lock */
SYNC_INDEX_TREE /* index->lock */
};
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index fc454826c2b..18114f18b14 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -330,14 +330,8 @@ row_mysql_unlock_data_dictionary(
/*********************************************************************//**
Locks the data dictionary in shared mode from modifications, for performing
foreign key check, rollback, or other operation invisible to MySQL. */
-void
-row_mysql_freeze_data_dictionary_func(
-/*==================================*/
- trx_t* trx, /*!< in/out: transaction */
- const char* file, /*!< in: file name */
- unsigned line); /*!< in: line number */
-#define row_mysql_freeze_data_dictionary(trx) \
- row_mysql_freeze_data_dictionary_func(trx, __FILE__, __LINE__)
+void row_mysql_freeze_data_dictionary(trx_t *trx);
+
/*********************************************************************//**
Unlocks the data dictionary shared lock. */
void
diff --git a/storage/innobase/include/sync0types.h b/storage/innobase/include/sync0types.h
index a12fb88ae55..b1fa2c52ca2 100644
--- a/storage/innobase/include/sync0types.h
+++ b/storage/innobase/include/sync0types.h
@@ -236,8 +236,6 @@ enum latch_level_t {
SYNC_DICT,
SYNC_FTS_CACHE,
- SYNC_DICT_OPERATION,
-
/** Level is varying. Only used with buffer pool page locks, which
do not have a fixed level, but instead have their level set after
the page is locked; see e.g. ibuf_bitmap_get_map_page(). */
@@ -291,7 +289,6 @@ enum latch_id_t {
LATCH_ID_WORK_QUEUE,
LATCH_ID_BUF_BLOCK_LOCK,
LATCH_ID_BUF_BLOCK_DEBUG,
- LATCH_ID_DICT_OPERATION,
LATCH_ID_FIL_SPACE,
LATCH_ID_FTS_CACHE,
LATCH_ID_FTS_CACHE_INIT,
@@ -960,7 +957,6 @@ struct sync_checker : public sync_check_functor_t
switch (level) {
case SYNC_FSP:
case SYNC_DICT:
- case SYNC_DICT_OPERATION:
case SYNC_FTS_CACHE:
case SYNC_NO_ORDER_CHECK:
return(false);
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 36f821e0e9b..ad097f4472c 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -3912,7 +3912,7 @@ row_import_for_mysql(
/* Prevent DDL operations while we are checking. */
- rw_lock_s_lock(&dict_sys.latch);
+ dict_sys.freeze();
row_import cfg;
@@ -3937,14 +3937,14 @@ row_import_for_mysql(
autoinc = cfg.m_autoinc;
}
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
DBUG_EXECUTE_IF("ib_import_set_index_root_failure",
err = DB_TOO_MANY_CONCURRENT_TRXS;);
} else if (cfg.m_missing) {
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
/* We don't have a schema file, we will have to discover
the index root pages from the .ibd file and skip the schema
@@ -3973,7 +3973,7 @@ row_import_for_mysql(
}
}
} else {
- rw_lock_s_unlock(&dict_sys.latch);
+ dict_sys.unfreeze();
}
if (err != DB_SUCCESS) {
@@ -4063,7 +4063,7 @@ row_import_for_mysql(
/* Open the tablespace so that we can access via the buffer pool.
We set the 2nd param (fix_dict = true) here because we already
- have an x-lock on dict_sys.latch and dict_sys.mutex.
+ have locked dict_sys.latch and dict_sys.mutex.
The tablespace is initially opened as a temporary one, because
we will not be writing any redo log for it before we have invoked
fil_space_t::set_imported() to declare it a persistent tablespace. */
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 5e41d037b6c..b3f0a33cedc 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -1481,8 +1481,6 @@ row_ins_check_foreign_constraint(
upd_node= NULL;
#endif /* WITH_WSREP */
- ut_ad(rw_lock_own(&dict_sys.latch, RW_LOCK_S));
-
err = DB_SUCCESS;
if (trx->check_foreigns == FALSE) {
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 02429aac23b..00e595c9252 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -3120,7 +3120,6 @@ row_log_table_apply(
stage->begin_phase_log_table();
- ut_ad(!rw_lock_own(&dict_sys.latch, RW_LOCK_S));
clust_index = dict_table_get_first_index(old_table);
if (clust_index->online_log->n_rows == 0) {
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 1558f0a9064..fb6efe92945 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -2060,18 +2060,11 @@ no_unlock:
/*********************************************************************//**
Locks the data dictionary in shared mode from modifications, for performing
foreign key check, rollback, or other operation invisible to MySQL. */
-void
-row_mysql_freeze_data_dictionary_func(
-/*==================================*/
- trx_t* trx, /*!< in/out: transaction */
- const char* file, /*!< in: file name */
- unsigned line) /*!< in: line number */
+void row_mysql_freeze_data_dictionary(trx_t *trx)
{
- ut_a(trx->dict_operation_lock_mode == 0);
-
- rw_lock_s_lock_inline(&dict_sys.latch, 0, file, line);
-
- trx->dict_operation_lock_mode = RW_S_LATCH;
+ ut_a(trx->dict_operation_lock_mode == 0);
+ trx->dict_operation_lock_mode = RW_S_LATCH;
+ dict_sys.freeze();
}
/*********************************************************************//**
@@ -2081,13 +2074,10 @@ row_mysql_unfreeze_data_dictionary(
/*===============================*/
trx_t* trx) /*!< in/out: transaction */
{
- ut_ad(lock_trx_has_sys_table_locks(trx) == NULL);
-
- ut_a(trx->dict_operation_lock_mode == RW_S_LATCH);
-
- rw_lock_s_unlock(&dict_sys.latch);
-
- trx->dict_operation_lock_mode = 0;
+ ut_ad(!lock_trx_has_sys_table_locks(trx));
+ ut_ad(trx->dict_operation_lock_mode == RW_S_LATCH);
+ dict_sys.unfreeze();
+ trx->dict_operation_lock_mode = 0;
}
/** Write query start time as SQL field data to a buffer. Needed by InnoDB.
@@ -2273,8 +2263,7 @@ row_mysql_lock_data_dictionary_func(
const char* file, /*!< in: file name */
unsigned line) /*!< in: line number */
{
- ut_a(trx->dict_operation_lock_mode == 0
- || trx->dict_operation_lock_mode == RW_X_LATCH);
+ ut_ad(trx->dict_operation_lock_mode == 0);
dict_sys.lock(file, line);
trx->dict_operation_lock_mode = RW_X_LATCH;
}
@@ -2287,7 +2276,7 @@ row_mysql_unlock_data_dictionary(
trx_t* trx) /*!< in/out: transaction */
{
ut_ad(lock_trx_has_sys_table_locks(trx) == NULL);
- ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
+ ut_ad(trx->dict_operation_lock_mode == RW_X_LATCH);
trx->dict_operation_lock_mode = 0;
dict_sys.unlock();
}
diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc
index 585060229d7..8f33f78f82e 100644
--- a/storage/innobase/row/row0umod.cc
+++ b/storage/innobase/row/row0umod.cc
@@ -245,8 +245,6 @@ row_undo_mod_clust(
ut_ad(thr_get_trx(thr) == node->trx);
ut_ad(node->trx->dict_operation_lock_mode);
ut_ad(node->trx->in_rollback);
- ut_ad(rw_lock_own_flagged(&dict_sys.latch,
- RW_LOCK_FLAG_X | RW_LOCK_FLAG_S));
log_free_check();
pcur = &node->pcur;
diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc
index e16ec4efe81..d1316196e1a 100644
--- a/storage/innobase/sync/sync0debug.cc
+++ b/storage/innobase/sync/sync0debug.cc
@@ -493,7 +493,6 @@ LatchDebug::LatchDebug()
LEVEL_MAP_INSERT(SYNC_STATS_AUTO_RECALC);
LEVEL_MAP_INSERT(SYNC_DICT);
LEVEL_MAP_INSERT(SYNC_FTS_CACHE);
- LEVEL_MAP_INSERT(SYNC_DICT_OPERATION);
LEVEL_MAP_INSERT(SYNC_LEVEL_VARYING);
LEVEL_MAP_INSERT(SYNC_NO_ORDER_CHECK);
@@ -738,7 +737,6 @@ LatchDebug::check_order(
case SYNC_REDO_RSEG:
case SYNC_NOREDO_RSEG:
case SYNC_PURGE_QUEUE:
- case SYNC_DICT_OPERATION:
case SYNC_DICT_HEADER:
case SYNC_IBUF_MUTEX:
case SYNC_INDEX_ONLINE_LOG:
@@ -839,7 +837,6 @@ LatchDebug::check_order(
ut_a(find(latches, SYNC_FSP) == &fil_system.temp_space->latch
|| find(latches, SYNC_INDEX_TREE)
- || find(latches, SYNC_DICT_OPERATION)
|| basic_check(latches, level, SYNC_TREE_NODE - 1));
break;
@@ -1306,9 +1303,6 @@ sync_latch_meta_init()
PFS_NOT_INSTRUMENTED);
#endif /* UNIV_DEBUG */
- LATCH_ADD_RWLOCK(DICT_OPERATION, SYNC_DICT_OPERATION,
- dict_operation_lock_key);
-
LATCH_ADD_RWLOCK(FIL_SPACE, SYNC_FSP, fil_space_latch_key);
LATCH_ADD_RWLOCK(FTS_CACHE, SYNC_FTS_CACHE, fts_cache_rw_lock_key);
diff --git a/storage/innobase/sync/sync0rw.cc b/storage/innobase/sync/sync0rw.cc
index 29a5c6cd036..5c0a4cee759 100644
--- a/storage/innobase/sync/sync0rw.cc
+++ b/storage/innobase/sync/sync0rw.cc
@@ -358,16 +358,8 @@ lock_loop:
return; /* Success */
}
- /* see comments in trx_commit_low() to
- before_trx_state_committed_in_memory explaining
- this care to invoke the following sync check.*/
-#ifndef DBUG_OFF
-#ifdef UNIV_DEBUG
- if (lock->get_level() != SYNC_DICT_OPERATION) {
- DEBUG_SYNC_C("rw_s_lock_waiting");
- }
-#endif
-#endif
+ DEBUG_SYNC_C("rw_s_lock_waiting");
+
sync_array_wait_event(sync_arr, cell);
i = 0;