Skip to content

Commit e31d920

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 3509826 commit e31d920

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pkg/kv/kvserver/replicate_queue.go

Lines changed: 7 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,21 @@ 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",
117+
false /*defaultValue*/),
115118
)
116119

117120
// ReplicateQueueMaxSize is a setting that controls the max size of the
118121
// replicate queue. When this limit is exceeded, lower priority replicas (not
119122
// guaranteed to be the lowest) are dropped from the queue.
120123
var ReplicateQueueMaxSize = settings.RegisterIntSetting(
121-
settings.ApplicationLevel,
124+
settings.SystemOnly,
122125
"kv.replicate_queue.max_size",
123126
"maximum number of replicas that can be queued for replicate queue processing; "+
124127
"when this limit is exceeded, lower priority (not guaranteed to be the lowest) "+
125128
"replicas are dropped from the queue",
126-
defaultQueueMaxSize,
129+
metamorphic.ConstantWithTestChoice[int64]("kv.replicate_queue.max_size",
130+
defaultQueueMaxSize /*defaultValue*/, math.MaxInt32 /*otherValues*/),
127131
settings.WithValidateInt(func(v int64) error {
128132
if v < defaultQueueMaxSize {
129133
return errors.Errorf("cannot be set to a value lower than %d: %d", defaultQueueMaxSize, v)

0 commit comments

Comments
 (0)