cockroachdb / cockroachdb/cockroach

kv: migrate liveness scans to cached or historical reads

Open
#165,111 1 comment 0 reactions 0 assignees View on GitHub
A-kv branch-master C-bug P-2 T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Follow-up to #165109 (audit of liveness range scan call sites).

For each call site identified as a misuse in the audit:

- Switch to `ScanNodeVitalityFromCache` where stale data is acceptable.
- Switch to historical (follower) reads where a consistent point-in-time
view is needed but real-time freshness is not. Historical reads avoid
conflicting with writers and eliminate false serialization from scan
latches spanning the entire range.
- Switch to the transactional API where the non-transactional API is
currently used. The non-transactional `db.Scan` assigns its read
timestamp at the replica on arrival, making it more likely to block
heartbeat writes.

Blocked on the audit (#165109) completing first.

See also #164066 (original issue).

Jira issue: CRDB-61210

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.