diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-04-12 21:18:14 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-04-12 21:29:21 +0530 |
commit | df057c47515844b8a86429f5bbae1c87ee20cd3b (patch) | |
tree | 55f86821399b77d72e288bfce1f7e6e98760736c | |
parent | 68e0defc5be41e42f5f9d050a436a5f88277a586 (diff) | |
download | mariadb-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.cc | 6 |
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; |