Skip to content

Commit

Permalink
MDEV-23026 purge fails with assert !rw_lock_own_flagged(lock, RW_LOCK…
Browse files Browse the repository at this point in the history
…_FLAG_X | RW_LOCK_FLAG_S)

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
  • Loading branch information
Thirunarayanan committed Apr 15, 2021
1 parent 343fe4e commit 7fa12b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6261,8 +6261,10 @@ ha_innobase::open(const char* name, int, uint)

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;
Expand Down

0 comments on commit 7fa12b1

Please sign in to comment.