From 6b7de866837293722f5537ebb742744b5630cda2 Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Mon, 6 Feb 2023 17:27:34 +0100 Subject: [PATCH] kvstorage: improve comment on DestroyReplica Epic: CRDB-220 Release note: None --- pkg/kv/kvserver/kvstorage/destroy.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/kv/kvserver/kvstorage/destroy.go b/pkg/kv/kvserver/kvstorage/destroy.go index 75d43bec2b45..d6506eaf099e 100644 --- a/pkg/kv/kvserver/kvstorage/destroy.go +++ b/pkg/kv/kvserver/kvstorage/destroy.go @@ -94,7 +94,13 @@ func ClearRangeData( } // DestroyReplica destroys all or a part of the Replica's state, installing a -// RangeTombstone in its place. +// RangeTombstone in its place. Due to merges, splits, etc, there is a need +// to control which part of the state this method actually gets to remove, +// which is done via the provided options[^1]; the caller is always responsible +// for managing the remaining disk state accordingly. +// +// [^1] e.g., on a merge, the user data moves to the subsuming replica and must +// not be cleared. func DestroyReplica( ctx context.Context, rangeID roachpb.RangeID,