cockroachdb / cockroachdb/cockroach

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

Open
#108,763 0 comments 0 reactions 0 assignees View on GitHub
A-multitenancy A-testing C-enhancement T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.