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 18:09:52 +0530
commit7fa12b1e34d3d561baed9e7f2aacb0d6a3eb7062 (patch)
tree5473387bbe31ed19a59720c4fd1001cce39aa21c
parent343fe4e2327cc3190ca97b44997f391640746590 (diff)
downloadmariadb-git-7fa12b1e34d3d561baed9e7f2aacb0d6a3eb7062.tar.gz
MDEV-23026 purge fails with assert !rw_lock_own_flagged(lock, RW_LOCK_FLAG_X | RW_LOCK_FLAG_S)st-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;