Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
-
LINUX
Description
We've see a server crash due to long semaphore wait. The innodb stats update thread updates stats(dict_stats_save_index_stat()) on a table using InnoDB internal parser, holding dict_operation_lock and dict_sys->mutext, but the plan is full table scan(innodb_index_stats) other than clust index scan. There are more than 200 thousands records in stats table, and there are multiple udpates for the table stats. So it takes more than 900s to finish.
The reason why stats updates use full table scan is that there is a running SQL: ALTER TABLE mysql.innodb_index_stats ENGINE=InnoDB STATS_PERSISTENT=0. The online DDL set cluster index of innodb_index_stats to ONLINE_INDEX_CREATION.
callstack:
prepare_inplace_alter_table_dict
--row_log_allocate
----dict_index_set_online_status
In function opt_calc_index_goodness():
343 /* At least for now we don't support using FTS indexes for queries
344 done through InnoDB's own SQL parser. */
345 if (dict_index_is_online_ddl(index) || (index->type & DICT_FTS))
In this case we should use the online index.
Attachments
Issue Links
- relates to
-
MDEV-33575 Assertion `rec_get_trx_id(rec, clust_index) < trx->id' failed in row_merge_read_clustered_index
-
- Confirmed
-
-
MDEV-33462 Server aborts while altering an InnoDB statistics table
-
- Closed
-
It turns out that in
MDEV-33462in MariaDB Server 10.6.18, the online table rebuild for InnoDB statistics tables was disabled. Therefore, this bug should not affect more recent MariaDB releases.In MariaDB Server 10.6, the MariaDB Server 10.5 test case for this bug would trigger the bug MDEV-33575 during the execution of ALTER TABLE mysql.innodb_index_stats.