@@ -15,6 +15,7 @@ import (
1515
1616 "github.com/cockroachdb/cockroach/pkg/clusterversion"
1717 "github.com/cockroachdb/cockroach/pkg/keys"
18+ "github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverpb"
1819 "github.com/cockroachdb/cockroach/pkg/raft/raftpb"
1920 "github.com/cockroachdb/cockroach/pkg/roachpb"
2021 "github.com/cockroachdb/cockroach/pkg/storage"
@@ -94,6 +95,14 @@ func (e *env) handleNewReplica(
9495 return desc
9596}
9697
98+ func (e * env ) handleRangeTombstone (
99+ t * testing.T , ctx context.Context , rangeID roachpb.RangeID , next roachpb.ReplicaID ,
100+ ) {
101+ require .NoError (t , MakeStateLoader (rangeID ).SetRangeTombstone (
102+ ctx , e .eng , kvserverpb.RangeTombstone {NextReplicaID : next },
103+ ))
104+ }
105+
97106func TestDataDriven (t * testing.T ) {
98107 defer leaktest .AfterTest (t )()
99108
@@ -146,6 +155,12 @@ func TestDataDriven(t *testing.T) {
146155 ); desc != nil {
147156 fmt .Fprintln (& buf , desc )
148157 }
158+
159+ case "range-tombstone" :
160+ rangeID := dd .ScanArg [roachpb.RangeID ](t , d , "range-id" )
161+ nextID := dd .ScanArg [roachpb.ReplicaID ](t , d , "next-replica-id" )
162+ e .handleRangeTombstone (t , ctx , rangeID , nextID )
163+
149164 case "load-and-reconcile" :
150165 replicas , err := LoadAndReconcileReplicas (ctx , e .eng )
151166 if err != nil {
0 commit comments