Skip to content

Commit

Permalink
Merge pull request #114278 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.2-114195

release-23.2: kvadmission: make `mode` cluster setting metamorphic
  • Loading branch information
aadityasondhi authored Nov 13, 2023
2 parents 1907203 + e060548 commit 7ed0b2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/kv/kvserver/kvflowcontrol/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ go_library(
"//pkg/kv/kvserver/kvflowcontrol/kvflowinspectpb",
"//pkg/roachpb",
"//pkg/settings",
"//pkg/util",
"//pkg/util/admission/admissionpb",
"@com_github_cockroachdb_redact//:redact",
"@com_github_dustin_go_humanize//:go-humanize",
Expand Down
7 changes: 6 additions & 1 deletion pkg/kv/kvserver/kvflowcontrol/kvflowcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvflowcontrol/kvflowinspectpb"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/settings"
"github.com/cockroachdb/cockroach/pkg/util"
"github.com/cockroachdb/cockroach/pkg/util/admission/admissionpb"
"github.com/cockroachdb/redact"
"github.com/dustin/go-humanize"
Expand All @@ -39,7 +40,11 @@ var Mode = settings.RegisterEnumSetting(
settings.SystemOnly,
"kvadmission.flow_control.mode",
"determines the 'mode' of flow control we use for replication traffic in KV, if enabled",
ApplyToElastic.String(),
util.ConstantWithMetamorphicTestChoice(
"kv.snapshot.ingest_as_write_threshold",
modeDict[ApplyToElastic], /* default value */
modeDict[ApplyToAll], /* other value */
).(string),
map[int64]string{
int64(ApplyToElastic): modeDict[ApplyToElastic],
int64(ApplyToAll): modeDict[ApplyToAll],
Expand Down

0 comments on commit 7ed0b2d

Please sign in to comment.