summaryrefslogtreecommitdiff
path: root/storage/innobase/srv/srv0srv.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-07-30 13:29:35 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-07-30 13:29:35 +0300
commita8642ba0072bc018c966dfa376de7c0190b23cd5 (patch)
tree7e051221bba66955fb12548aa8e6925fc0faeb3c /storage/innobase/srv/srv0srv.cc
parentc69286b73e4dec4d488fb2ad7a248a4905a5ec4b (diff)
downloadmariadb-git-bb-10.6-MDEV-24258.tar.gz
MDEV-24258 Merge dict_sys.mutex into dict_sys.latchbb-10.6-MDEV-24258
Thanks to the preparation, dict_sys.latch was only being acquired in exclusive mode. Thus, it could theoretically have been replaced with a mutex. But, we can do better and merge dict_sys.mutex into dict_sys.latch. Generally, every occurrence of dict_sys.mutex_lock() will be replaced with dict_sys.lock(). Much of the current use of dict_sys.lock() will be replaced with dict_sys.freeze(), which we will reintroduce for the new shared mode. The PERFORMANCE_SCHEMA instrumentation for dict_sys_mutex will be removed along with dict_sys.mutex. The dict_sys.latch will remain instrumented as dict_operation_lock. As demonstrated by the test perfschema.sxlock_func, there will be less contention on dict_sys.latch, because some previous use of exclusive latches will be replaced with shared latches. fts_parse_sql_no_dict_lock(): Replaced with pars_sql(). fts_get_table_name_prefix(): Merged to fts_optimize_create(). dict_stats_update_transient_for_index(): Deduplicated some code. ha_innobase::info_low(), dict_stats_stop_bg(): Use a combination of dict_sys.latch and table->stats_mutex_lock() to cover the changes of BG_STAT_SHOULD_QUIT, because the flag is being read in dict_stats_update_persistent() while not holding dict_sys.latch. row_discard_tablespace_for_mysql(): Protect stats_bg_flag by exclusive dict_sys.latch, like most other code does. row_quiesce_table_has_fts_index(): Remove unnecessary mutex acquisition. FLUSH TABLES...FOR EXPORT is protected by MDL. row_import::set_root_by_heuristic(): Remove unnecessary mutex acquisition. ALTER TABLE...IMPORT TABLESPACE is protected by MDL. row_ins_sec_index_entry_low(): Replace a call to dict_set_corrupted_index_cache_only(). Reads of index->type were not really protected by dict_sys.mutex, and writes (flagging an index corrupted) should be extremely rare.
Diffstat (limited to 'storage/innobase/srv/srv0srv.cc')
-rw-r--r--storage/innobase/srv/srv0srv.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 81e0a3d2b79..d76a98e83e7 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -1297,7 +1297,7 @@ void srv_monitor_task(void*)
|| waited == threshold / 2
|| waited == threshold / 4 * 3) {
ib::warn() << "Long wait (" << waited
- << " seconds) for dict_sys.mutex";
+ << " seconds) for dict_sys.latch";
}
}
}
@@ -1371,8 +1371,6 @@ void purge_sys_t::stop_SYS()
/** Stop purge during FLUSH TABLES FOR EXPORT */
void purge_sys_t::stop()
{
- dict_sys.assert_not_locked();
-
for (;;)
{
latch.wr_lock(SRW_LOCK_CALL);