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

spanconfig: enable range coalescing by default #98820

Merged
merged 1 commit into from
May 8, 2023

Commits on May 8, 2023

  1. spanconfig: enable range coalescing by default

    Fixes cockroachdb#81008.
    
    We built the basic infrastructure to coalesce ranges across table
    boundaries back in 22.2 as part of cockroachdb#66063. We've enabled this
    optimization for secondary tenants since then, but hadn't for the system
    tenant because of two primary blockers:
    
    - cockroachdb#93617: SHOW RANGES was broken by coalesced ranges.
    - cockroachdb#84105: APIs to compute sizes for schema objects (used in our UI) was
      broken by coalesced ranges.
    
    In both these cases we baked in assumptions about there being a minimum
    of one-{table,index,partition}-per-range. These blockers didn't apply to
    secondary tenants at the time since they didn't have access to SHOW
    RANGES, nor the UI pages where these schema statistics were displayed.
    
    We've addressed both these blockers in the 23.1 cycle as part of
    bridging the compatibility between secondary tenants and yesteryear's
    system tenant.
    - cockroachdb#93644 revised SHOW RANGES and crdb_internal.ranges{,_no_leases}, both
      internally and its external UX, to accommodate ranges straddling
      table/database boundaries.
    - cockroachdb#96223 re-worked our SpanStats API to work in the face of coalesced
      ranges, addressing cockroachdb#84105.
    
    Release note (general change): CockroachDB would previously use separate
    ranges for each table, index, or partition. This is no longer true --
    it's possible now to have multiple tables, indexes, and partitions to
    get packed into the same range. For users with many such "schema
    objects", this will reduce the total range count in their clusters. This
    is especially true if individual tables, indexes, or partitions are
    smaller than the default configured maximum range size (controlled using
    zone configs, specifically the range_max_bytes parameter).
    We made this change to improve scalability with respect to the number of
    schema objects, since the underlying range count now no longer a
    bottleneck. Users upgrading from 22.2, once finalizing their upgrade,
    may observe a round of range merges and snapshot transfers (to power
    said range merges) as a result of this change. If users want to opt-out
    of this optimization, they can use the following cluster setting:
    
      SET CLUSTER SETTING spanconfig.storage_coalesce_adjacent.enabled = false;
    irfansharif committed May 8, 2023
    Configuration menu
    Copy the full SHA
    7a57e7e View commit details
    Browse the repository at this point in the history