summaryrefslogtreecommitdiff
path: root/storage/innobase/include/dict0mem.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-08-31 13:54:55 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-08-31 13:54:55 +0300
commit45a05fda27dc7058ce8a89f14b1daa56352adf6b (patch)
tree5f8498390a42a9861cbc7ff3d2115a650aeb0634 /storage/innobase/include/dict0mem.h
parentc5fd9aa562fb15e8d6ededceccbec0c9792a3243 (diff)
downloadmariadb-git-45a05fda27dc7058ce8a89f14b1daa56352adf6b.tar.gz
MDEV-25919: Replace dict_table_t::stats_bg_flag with MDL
The purpose of dict_table_t::stats_bg_flag was to prevent race conditions between DDL operations and a background thread that updates persistent statistics for InnoDB tables. Now that with the parent commit, we started to acquire a shared meta-data lock (MDL) on the InnoDB persistent statistics tables in background tasks that access them, we may easily acquire MDL on the table for which the statistics are being updated. This will by design prevent race conditions with any DDL operations on that table, and the stats_bg_flag may be removed. dict_stats_process_entry_from_recalc_pool(): Complete rewrite. During the processing, retain the entry in recalc_pool, so that dict_stats_recalc_pool_del() will be able to request deletion of the entry, or delete the entry if its caller is holding MDL_EXCLUSIVE while we are waiting for MDL. recalc_pool: In addition to the table ID, store a state for inter-thread communication, so that dict_stats_recalc_pool_del() can wait until all processing is finished. Reviewed by: Thirunarayanan Balathandayuthapani
Diffstat (limited to 'storage/innobase/include/dict0mem.h')
-rw-r--r--storage/innobase/include/dict0mem.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index 8d636e056ee..417a65f1b09 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -2244,24 +2244,6 @@ public:
any latch, because this is only used for heuristics. */
ib_uint64_t stat_modified_counter;
- /** Background stats thread is not working on this table. */
- #define BG_STAT_NONE 0
-
- /** Set in 'stats_bg_flag' when the background stats code is working
- on this table. The DROP TABLE code waits for this to be cleared before
- proceeding. */
- #define BG_STAT_IN_PROGRESS (1 << 0)
-
- /** Set in 'stats_bg_flag' when DROP TABLE starts waiting on
- BG_STAT_IN_PROGRESS to be cleared. The background stats thread will
- detect this and will eventually quit sooner. */
- #define BG_STAT_SHOULD_QUIT (1 << 1)
-
- /** The state of the background stats thread wrt this table.
- See BG_STAT_NONE, BG_STAT_IN_PROGRESS and BG_STAT_SHOULD_QUIT.
- Writes are covered by dict_sys.latch and stats_mutex_lock(). */
- byte stats_bg_flag;
-
bool stats_error_printed;
/*!< Has persistent stats error beein
already printed for this table ? */