Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-22.2.0: stats: fix missing autostats on cluster startup #89316

Closed

Commits on Oct 4, 2022

  1. stats: fix missing autostats on cluster startup

    Fixes cockroachdb#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.
    Mark Sirek committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    921d3a4 View commit details
    Browse the repository at this point in the history