-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stats: fix missing autostats on cluster startup
Fixes #87247 Previously, automatic statistics may fail to be collected on tables with no stats at cluster startup when the `sql.stats.automatic_collection.enabled` cluster setting is false but table storage parameter `sql_stats_automatic_collection_enabled` is true. Method `ensureAllTables` does not put entries into the settingOverrides map, and since storage parameter info is not normally looked up in the table header in auto stats processing, we fall back on the cluster setting to determine if auto stats should be collected. To address this, this patch modifies auto stats to flag whether the current batch of tables saved in the mutationCounts map comes from cluster startup processing, and if so, ensures that storage parameters controlling auto stats are always looked up in the table header during that processing. Release note (bug fix): This patch fixes missing automatic statistics collection at cluster startup when the `sql.stats.automatic_collection.enabled` cluster setting is false, but there are tables with storage parameter `sql_stats_automatic_collection_enabled` set to true.
- Loading branch information
Mark Sirek
committed
Sep 26, 2022
1 parent
51c8aae
commit b2e0f43
Showing
2 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters