Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions pkg/kv/kvserver/client_raft_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,44 +292,19 @@ func setupPartitionedRangeWithHandlers(
return pr, nil
}

func (pr *testClusterPartitionedRange) deactivate() { pr.set(false) }
func (pr *testClusterPartitionedRange) activate() { pr.set(true) }
func (pr *testClusterPartitionedRange) activate() { pr.set(true) }
func (pr *testClusterPartitionedRange) set(active bool) {
pr.mu.Lock()
defer pr.mu.Unlock()
pr.mu.partitioned = active
}

func (pr *testClusterPartitionedRange) addReplica(replicaID roachpb.ReplicaID) {
pr.mu.Lock()
defer pr.mu.Unlock()
pr.mu.partitionedReplicas[replicaID] = true
}

func (pr *testClusterPartitionedRange) addStore(storeID roachpb.StoreID) {
pr.mu.Lock()
defer pr.mu.Unlock()
pr.mu.partitionedStores[storeID] = true
}

func (pr *testClusterPartitionedRange) removeStore(storeID roachpb.StoreID) {
pr.mu.Lock()
defer pr.mu.Unlock()

pr.mu.partitionedStores[storeID] = false
}

func (pr *testClusterPartitionedRange) extend(
tc *testcluster.TestCluster,
rangeID roachpb.RangeID,
replicaID roachpb.ReplicaID,
partitionedNode int,
activated bool,
funcs kvtestutils.UnreliableRaftHandlerFuncs,
) (*testClusterPartitionedRange, error) {
return setupPartitionedRangeWithHandlers(tc, rangeID, replicaID, partitionedNode, activated, pr.handlers, funcs)
}

// dropRaftMessagesFrom sets up a Raft message handler on the given server that
// drops inbound Raft messages from the given range and replica IDs. In addition
// to raft messages, StoreLiveness messages from the replica IDs' store are also
Expand Down
Loading