summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-04-12 21:18:14 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-04-15 11:48:45 +0530
commit6f4e27d5199648e2e2a4f29e82ad9b6b6fa617cf (patch)
tree1c36cc382ff865c3a10cf309d636d9a17321dd38
parent3ebd6cd3ad7c4f7584837d37452f3a456dd48085 (diff)
downloadmariadb-git-bb-10.2-MDEV-23026.tar.gz
MDEV-23026 purge fails with assert !rw_lock_own_flagged(lock, RW_LOCK_FLAG_X | RW_LOCK_FLAG_S)bb-10.2-MDEV-23026
InnoDB purge thread locks the root page of clustered index while accessing the undo log records and later same thread tries to open the table, initialize statistics and tries to lock the clustered index root page while doing virtual column computation. Solution: ========= InnoDB should prevent statistics initialization when the table is being opened by purge thread
-rw-r--r--storage/innobase/handler/ha_innodb.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index fc876e6f753..b837aec396b 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -6261,8 +6261,10 @@ no_such_table:
innobase_copy_frm_flags_from_table_share(ib_table, table->s);
- /* No point to init any statistics if tablespace is still encrypted. */
- if (ib_table->is_readable()) {
+ /* No point to init any statistics if tablespace is still encrypted
+ or if table is being opened by background thread */
+ if (THDVAR(thd, background_thread)) {
+ } else if (ib_table->is_readable()) {
dict_stats_init(ib_table);
} else {
ib_table->stat_initialized = 1;