Skip to content

kvserver: MVCC-compliant RevertRange variant #70416

@erikgrinaker

Description

@erikgrinaker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-kv-serverRelating to the KV-level RPC serverC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions