-
Notifications
You must be signed in to change notification settings - Fork 4.1k
kvserver: MVCC-compliant RevertRange variant #70416
Description
As described in #69380, we need an MVCC-compliant variant of RevertRange that allows us to undo recent changes to a key span, typically in order to cancel bulk operations such as IMPORT INTO. Conceptually, this needs to iterate across the visible keys at the target revert time (including tombstones), and any keys that have a different most-recent value must be replaced by its original value. In the case of deletes, if there are long runs of keys to delete, it should drop an MVCC range tombstone instead.
To accomplish this, we should add a lower timestamp predicate to DeleteRange that will only drop tombstones over keys that have a timestamp at or later than the given lower timestamp. It should use range tombstones where possible, to delete long runs of matching keys, but fall back to point tombstones when necessary.
See also the (currently internal) design document.
Epic CRDB-2624
Jira issue: CRDB-10066