Skip to content

Commit bf7861b

Browse files
committed
kvserver: make PriorityInversionRequeue and ReplicateQueueMaxSize metamorphic
Previously, we introduced the cluster settings PriorityInversionRequeue and ReplicateQueueMaxSize, defaulting them to true and math.MaxInt64 on master but keeping them disabled and defaultQueueMaxSize on release branches. To allow additional bake time in release branches, this commit makes both settings metamorphic on the release branches.
1 parent b8345b7 commit bf7861b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/kv/kvserver/replicate_queue.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package kvserver
88
import (
99
"context"
1010
"fmt"
11+
"math"
1112
"time"
1213

1314
"github.com/cockroachdb/cockroach/pkg/gossip"
@@ -24,6 +25,7 @@ import (
2425
"github.com/cockroachdb/cockroach/pkg/spanconfig"
2526
"github.com/cockroachdb/cockroach/pkg/util/hlc"
2627
"github.com/cockroachdb/cockroach/pkg/util/log"
28+
"github.com/cockroachdb/cockroach/pkg/util/metamorphic"
2729
"github.com/cockroachdb/cockroach/pkg/util/metric"
2830
"github.com/cockroachdb/cockroach/pkg/util/retry"
2931
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
@@ -111,19 +113,20 @@ var PriorityInversionRequeue = settings.RegisterBoolSetting(
111113
"kv.priority_inversion_requeue_replicate_queue.enabled",
112114
"whether the requeue replicas should requeue when enqueued for "+
113115
"repair action but ended up consider rebalancing during processing",
114-
false,
116+
metamorphic.ConstantWithTestBool("kv.priority_inversion_requeue_replicate_queue.enabled", false /*defaultValue*/),
115117
)
116118

117119
// ReplicateQueueMaxSize is a setting that controls the max size of the
118120
// replicate queue. When this limit is exceeded, lower priority replicas (not
119121
// guaranteed to be the lowest) are dropped from the queue.
120122
var ReplicateQueueMaxSize = settings.RegisterIntSetting(
121-
settings.ApplicationLevel,
123+
settings.SystemOnly,
122124
"kv.replicate_queue.max_size",
123125
"maximum number of replicas that can be queued for replicate queue processing; "+
124126
"when this limit is exceeded, lower priority (not guaranteed to be the lowest) "+
125127
"replicas are dropped from the queue",
126-
defaultQueueMaxSize,
128+
metamorphic.ConstantWithTestChoice[int64]("kv.replicate_queue.max_size",
129+
defaultQueueMaxSize /*defaultValue*/, math.MaxInt32 /*otherValues*/),
127130
settings.WithValidateInt(func(v int64) error {
128131
if v < defaultQueueMaxSize {
129132
return errors.Errorf("cannot be set to a value lower than %d: %d", defaultQueueMaxSize, v)

0 commit comments

Comments
 (0)