Skip to content

Commit ddd5aa3

Browse files
authored
Merge pull request #153080 from wenyihu6/backportrelease-24.3.20-rc-153077
release-24.3.20-rc: kvserver: make PriorityInversionRequeue and ReplicateQueueMaxSize metamorphic
2 parents b8345b7 + bf7861b commit ddd5aa3

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)