Commit graph

8 commits

Author SHA1 Message Date
Marko Mäkelä
6e6a1b316c MDEV-35000: dict_table_close() breaks STATS_AUTO_RECALC
stats_deinit(): Replaces dict_stats_deinit().
Deinitialize the statistics for persistent tables,
so that they will be reloaded or recalculated
on a subsequent ha_innobase::open().

ha_innobase::rename_table(): Invoke stats_deinit() so that the
subsequent ha_innobase::open() will reload the InnoDB persistent
statistics. That is, it will remain possible to have the InnoDB
persistent statistics reloaded by executing the following:
RENAME TABLE t TO tmp, tmp TO t;

dict_table_close(table): Replaced with table->release().
There will no longer be any logic that would attempt to ensure
that the InnoDB persistent statistics will be reloaded after
FLUSH TABLES has been executed. This also fixes the problem that
dict_table_t::stat_modified_counter would be frequently reset to 0,
whenever ha_innobase::open() is invoked after the table reference
count had dropped to 0.

dict_table_close(table, thd, mdl): Remove the parameter "dict_locked".
Do not try to invalidate the statistics.

ha_innobase::statistics_init(): Replaces dict_stats_init(table).

Reviewed by: Thirunarayanan Balathandayuthapani
2025-02-28 09:00:16 +02:00
Thirunarayanan Balathandayuthapani
d9ffefdaac Merge 10.5 into 10.6 2024-07-10 18:27:23 +02:00
Thirunarayanan Balathandayuthapani
60125a77b7 MDEV-34474 InnoDB: Failing assertion: stat_n_leaf_pages > 0 in ha_innobase::estimate_rows_upper_bound
- Column stat_value and sample_size in mysql.innodb_index_stats
table is declared as BIGINT UNSIGNED without any check constraint.
user manually updates the value of stat_value and sample_size
to zero. InnoDB aborts the server while reading the statistics
information because InnoDB expects at least one leaf
page to exist for the index.

- To fix this issue, InnoDB should interpret the value of
stat_n_leaf_pages, stat_index_size in innodb_index_stats
stat_clustered_index_size, stat_sum_of_other_index_sizes
in innodb_table_stats as valid one even though user
mentioned it as 0.
2024-07-10 11:43:03 +05:30
Thirunarayanan Balathandayuthapani
e66928ab28 MDEV-33462 Server aborts while altering an InnoDB statistics table
Problem:
=======
- When online alter of InnoDB statistics table happens,
any transaction which updates the statistics table
has to read the undo log and log the DML changes during
transaction commit. Applying undo log
(UndorecApplier::apply_undo_rec) requires a shared
lock on dictionary cache but dict_stats_save() already
holds write lock on dictionary cache. This leads to
abort of server during commit of statistics table changes.

Solution:
========
- Disallow LOCK=NONE operation for the InnoDB statistics table.
The reasoning is that statistics tables are typically
rather small, so any blocking would be rather short.
Writes to the statistics tables should be a rare operation.
2024-02-22 16:57:04 +05:30
Thirunarayanan Balathandayuthapani
d9ae5820c5 MDEV-32890 LeakSanitizer errors in mem_heap_create_block_func upon query from I_S.INNODB_SYS_TABLES with LIMIT ROWS EXAMINED
- innodb_sys_tables query fails to free the object which contains
sys_tables information in case of error.
2023-11-28 13:42:08 +05:30
Thirunarayanan Balathandayuthapani
84e0c027e0 MDEV-28613 LeakSanitizer caused by I_S query using LIMIT ROWS EXAMINED
Problem:
========
- InnoDB fails to free the allocated buffer of stored cursor
when information schema query is interrupted.

Solution:
=========
- In case of error handling, information schema query should free
the allocated buffer to store the cursor.
2023-11-21 11:13:43 +05:30
Marko Mäkelä
e6bdf77e4b Merge 10.3 into 10.4
In is_eits_usable(), we disable an assertion that fails due to
MDEV-19334.
2019-04-25 16:05:20 +03:00
Igor Babaev
5d20f7b346 Added missing tests for innodb persistent statistics (from mysql-5.6.10)
Made sure that innodb tables for persistent statistics would not
considered by the server as system tables.
2013-08-07 17:08:51 -07:00