Skip to content

Commit

Permalink
kvflowcontrol: re-enable kvadmission.flow_control.mode metamorphism
Browse files Browse the repository at this point in the history
The cluster setting `kvadmission.flow_control.mode` is used to control
whether replication admission control applies to only elastic work, or
applies to all work which sets an admission priority.

The cluster setting was prior to cockroachdb#132125, metamorphic in tests,
selecting either value with equal probability. cockroachdb#132125 disabled the
metamorphism in order to prevent the newly introduced send queue / pull
mode from being run unexpectedly, while still under testing.

With testing now in place, re-enable the metamorphism, leaving the
default value unchanged.

Resolves: cockroachdb#132364
Release note: None
  • Loading branch information
kvoli committed Oct 30, 2024
1 parent 2d0a67f commit b3b2106
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 @@ -18,6 +18,7 @@ go_library(
"//pkg/settings",
"//pkg/settings/cluster",
"//pkg/util/admission/admissionpb",
"//pkg/util/metamorphic",
"@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 @@ -19,6 +19,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/settings"
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/util/admission/admissionpb"
"github.com/cockroachdb/cockroach/pkg/util/metamorphic"
"github.com/cockroachdb/redact"
"github.com/dustin/go-humanize"
)
Expand All @@ -41,7 +42,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",
modeDict[ApplyToElastic], /* default value */
metamorphic.ConstantWithTestChoice(
"kvadmission.flow_control.mode",
modeDict[ApplyToElastic], /* default value */
modeDict[ApplyToAll], /* other value */
),
modeDict,
)

Expand Down

0 comments on commit b3b2106

Please sign in to comment.