cockroachdb / cockroachdb/cockroach
kv: migrate liveness scans to cached or historical reads
- 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
Assessment
This issue has not been assessed yet.