Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-23.1: sql: disable lease and merge queue in relocate tests #131884

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 6 additions & 0 deletions pkg/sql/multitenant_admin_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/config/zonepb"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverbase"
"github.com/cockroachdb/cockroach/pkg/multitenant/tenantcapabilities"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/server"
Expand Down Expand Up @@ -61,6 +62,7 @@ func createTestClusterArgs(ctx context.Context, numReplicas, numVoters int32) ba

clusterSettings := cluster.MakeTestingClusterSettings()
kvserver.LoadBasedRebalancingMode.Override(ctx, &clusterSettings.SV, int64(kvserver.LBRebalancingOff))
kvserverbase.MergeQueueEnabled.Override(ctx, &clusterSettings.SV, false)
return base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
Settings: clusterSettings,
Expand Down Expand Up @@ -731,6 +733,7 @@ func TestRelocateVoters(t *testing.T) {
require.NoErrorf(t, err, message)
err = testCluster.WaitForFullReplication()
require.NoErrorf(t, err, message)
testCluster.ToggleLeaseQueues(false)
testCluster.ToggleReplicateQueues(false)
replicaState := getReplicaState(
t,
Expand Down Expand Up @@ -808,6 +811,7 @@ func TestExperimentalRelocateVoters(t *testing.T) {
require.NoErrorf(t, err, message)
err = testCluster.WaitForFullReplication()
require.NoErrorf(t, err, message)
testCluster.ToggleLeaseQueues(false)
testCluster.ToggleReplicateQueues(false)
replicaState := getReplicaState(
t,
Expand Down Expand Up @@ -900,6 +904,7 @@ func TestRelocateNonVoters(t *testing.T) {
require.NoErrorf(t, err, message)
err = testCluster.WaitForFullReplication()
require.NoErrorf(t, err, message)
testCluster.ToggleLeaseQueues(false)
testCluster.ToggleReplicateQueues(false)
replicaState := getReplicaState(
t,
Expand Down Expand Up @@ -972,6 +977,7 @@ func TestExperimentalRelocateNonVoters(t *testing.T) {
require.NoErrorf(t, err, message)
err = testCluster.WaitForFullReplication()
require.NoErrorf(t, err, message)
testCluster.ToggleLeaseQueues(false)
testCluster.ToggleReplicateQueues(false)
replicaState := getReplicaState(
t,
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 @@ -245,6 +245,10 @@ type TestClusterInterface interface {
// ToggleReplicateQueues activates or deactivates the replication queues on all
// the stores on all the nodes.
ToggleReplicateQueues(active bool)

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

// SplitPoint describes a split point that is passed to SplitTable.
Expand Down
10 changes: 10 additions & 0 deletions pkg/testutils/testcluster/testcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,16 @@ func (tc *TestCluster) ToggleReplicateQueues(active bool) {
}
}

// ToggleLeaseQueues implements TestClusterInterface.
func (tc *TestCluster) ToggleLeaseQueues(active bool) {
for _, s := range tc.Servers {
_ = s.StorageLayer().GetStores().(*kvserver.Stores).VisitStores(func(store *kvserver.Store) error {
store.TestingSetLeaseQueueActive(active)
return nil
})
}
}

// ReadIntFromStores reads the current integer value at the given key
// from all configured engines, filling in zeros when the value is not
// found.
Expand Down