Skip to content

kvserver/rangefeed: only scan separated intents span to bootstrap resolved timestamp #69697

@ajwerner

Description

@ajwerner

Is your feature request related to a problem? Please describe.
Today we initialize the resolved timestamp by iterating all of the intents in the range. We do this by iterating the entire range and only looking at the intents. We set up the iterator here:

return r.Engine().NewMVCCIterator(storage.MVCCKeyAndIntentsIterKind, storage.IterOptions{
and we skip over the values here:
// If the key is not a metadata key, ignore it.

If we were to restrict this scan to only the separated intents on ranges which have been fully migrated to only use separated intents, we could avoid a full data scan during rangefeed startup. This is a big win!

Describe the solution you'd like

We should set up the RTS iterator to only look at the separated intents when appropriate.

Additional context

There's been talk in the past of storing the resolved timestamp start. I don't think we need to do this with the separated intents.

Metadata

Metadata

Assignees

Labels

A-cdcChange Data CaptureA-kv-serverRelating to the KV-level RPC serverC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-cdcT-disaster-recovery

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions