Skip to content

sql: figure out how to populate range cache in secondary tenants #108763

@knz

Description

@knz

In single-tenant world we propagate "misplanned ranges" metadata (which updates the DistSender's range cache of the gateway for the query) in ad-hoc fashion: namely, if we distribute the query but place the TableReaders not on leaseholders of the ranges, then those TableReaders produce the "misplanned ranges" metadata that is sent back to the gateway. Currently, this mechanism doesn't work in secondary tenants for two reasons:

  • we use random placement of TableReaders
  • when creating metadata, the TableReaders don't have access to NodeID which is a requirement for the "misplanned ranges" metadata generation.

We need to figure out how we want to improve the situation (perhaps shared-process and separate-process modes will behave differently). We also need to find a way of triggering the range cache population (ideally via SQL) that we often use in tests (one example where this is currently needed is TestSpanResolverUsesCaches).

xref #76378.

Jira issue: CRDB-30627
Epic: CRDB-48357

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-multitenancyRelated to multi-tenancyA-testingTesting tools and infrastructureC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries Team

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions