kvserver: ClearRange optimization does not remove separated intents #61606
Labels
A-kv-server
Relating to the KV-level RPC server
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
ClearRange
normally usesWriter.ClearMVCCRangeAndIntents
to remove the range, but has an optimization for small ranges where it instead removes keys directly:cockroach/pkg/kv/kvserver/batcheval/cmd_clear_range.go
Lines 84 to 109 in b7fb524
However, when
clusterversion.SeparatedIntents
is enabled, this will only remove the key but not its intent (which is stored in a separate lock table). This can cause subsequentEngine
operations to error because of the unexpected intent, as seen e.g. inTestTxnClearRangeIntents
in #61544.This is related to #46764, in that clearing intents may in itself be considered a bug since it can abort an implicitly committed transaction.
The text was updated successfully, but these errors were encountered: