-
Notifications
You must be signed in to change notification settings - Fork 4.1k
storage: require Valid() for HasPointAndRange() in MVCCIterator #83801
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-performancePerf of queries or internals. Solution not expected to change functional behavior.Perf of queries or internals. Solution not expected to change functional behavior.
Description
Currently, MVCCIterator mandates that HasPointAndRange() must return a consistent value with true. However, this means that pebbleIterator.HasPointAndRange() needs to call through to Valid() to do additional checks (e.g. that we haven't moved into the lock table), but most times the caller has already called Valid(). This additional validation can be expensive, and HasPointAndRange() has been seen to have a non-negligible cost.
We should change the MVCCIterator contract to require Valid() to be called before HasPointAndRange(), to avoid this cost.
Jira issue: CRDB-17273
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-performancePerf of queries or internals. Solution not expected to change functional behavior.Perf of queries or internals. Solution not expected to change functional behavior.