Skip to content

Commit

Permalink
kvserver: disable replicate queue and lease transfers in closedts tests
Browse files Browse the repository at this point in the history
For a more holistic suggestion on how to fix this for the likely many other
tests susceptible to similar issues, see:
#107528

Fixes #101824.

Release note: None
Epic: none
  • Loading branch information
tbg authored and erikgrinaker committed Aug 12, 2023
1 parent c9a07d4 commit 9eb871a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/kv/kvserver/closed_timestamp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1197,9 +1197,15 @@ func setupClusterForClosedTSTesting(
SET CLUSTER SETTING kv.closed_timestamp.target_duration = '%s';
SET CLUSTER SETTING kv.closed_timestamp.side_transport_interval = '%s';
SET CLUSTER SETTING kv.closed_timestamp.follower_reads_enabled = true;
SET CLUSTER SETTING kv.allocator.load_based_rebalancing = 'off';
`, targetDuration, targetDuration/4),
";")...)

// Disable replicate queues to avoid errant lease transfers.
//
// See: https://github.com/cockroachdb/cockroach/issues/101824.
tc.ToggleReplicateQueues(false)

return tc, tc.ServerConn(0), desc
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/testutils/serverutils/test_cluster_shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ type TestClusterInterface interface {
// TODO(radu): we should verify that the queries in tests using SplitTable
// are indeed distributed as intended.
SplitTable(t *testing.T, desc catalog.TableDescriptor, sps []SplitPoint)

// ToggleReplicateQueues activates or deactivates the replication queues on all
// the stores on all the nodes.
ToggleReplicateQueues(active bool)
}

// SplitPoint describes a split point that is passed to SplitTable.
Expand Down

0 comments on commit 9eb871a

Please sign in to comment.