-
Notifications
You must be signed in to change notification settings - Fork 4.1k
storage: new data type for MVCC range key stacks #83895
Copy link
Copy link
Closed
Labels
A-kv-replicationRelating to Raft, consensus, and coordination.Relating to Raft, consensus, and coordination.A-storageRelating to our storage engine (Pebble) on-disk storage.Relating to our storage engine (Pebble) on-disk storage.C-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.
Description
SimpleMVCCIterator.RangeKeys() currently returns []MVCCRangeKeyValue. However, this stack has a few special properties: it is ordered by timestamp (descending), and all range keys have the same bounds. We have a fair but of code which assumes []MVCCRangeKeyValue has these properties, so that it can e.g. do binary searches.
We should consider using a distinct type for these, e.g. MVCCRangeKeyStack, which is guaranteed to have these properties. Then e.g. FirstRangeKeyAbove() and HasRangeKeyBetween() would be methods of this type, and we could possibly omit the key bound duplication for each element.
Jira issue: CRDB-17344
Epic CRDB-2624
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-kv-replicationRelating to Raft, consensus, and coordination.Relating to Raft, consensus, and coordination.A-storageRelating to our storage engine (Pebble) on-disk storage.Relating to our storage engine (Pebble) on-disk storage.C-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.