From b3b2106e813502783140d177319a99e1948359ec Mon Sep 17 00:00:00 2001 From: Austen McClernon Date: Wed, 30 Oct 2024 17:16:47 +0000 Subject: [PATCH] kvflowcontrol: re-enable kvadmission.flow_control.mode metamorphism 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 #132125, metamorphic in tests, selecting either value with equal probability. #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: #132364 Release note: None --- pkg/kv/kvserver/kvflowcontrol/BUILD.bazel | 1 + pkg/kv/kvserver/kvflowcontrol/kvflowcontrol.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/kv/kvserver/kvflowcontrol/BUILD.bazel b/pkg/kv/kvserver/kvflowcontrol/BUILD.bazel index 6f358f3ca542..1c49ded700dd 100644 --- a/pkg/kv/kvserver/kvflowcontrol/BUILD.bazel +++ b/pkg/kv/kvserver/kvflowcontrol/BUILD.bazel @@ -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", ], diff --git a/pkg/kv/kvserver/kvflowcontrol/kvflowcontrol.go b/pkg/kv/kvserver/kvflowcontrol/kvflowcontrol.go index 7662f094e341..e34ad32310e2 100644 --- a/pkg/kv/kvserver/kvflowcontrol/kvflowcontrol.go +++ b/pkg/kv/kvserver/kvflowcontrol/kvflowcontrol.go @@ -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" ) @@ -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, )