Skip to content

Commit

Permalink
admission: temporary knob to disable AC for user requests
Browse files Browse the repository at this point in the history
informs: cockroachdb#85641

Temporary knob to allow disabling admission control for non-elastic /
bulk requests.

Release note: None
  • Loading branch information
andrewbaptist committed Nov 3, 2022
1 parent 081f108 commit c8c8535
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/kv/kvserver/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3910,6 +3910,13 @@ func (n *KVAdmissionControllerImpl) AdmitKVWork(
if source == roachpb.AdmissionHeader_OTHER {
bypassAdmission = true
}
// TODO(abaptist): Revisit and deprecate this setting in v23.1.
if admission.KVBulkOnlyAdmissionControlEnabled.Get(&n.settings.SV) {
if admissionpb.WorkPriority(ba.AdmissionHeader.Priority) >= admissionpb.NormalPri {
bypassAdmission = true
}
}

createTime := ba.AdmissionHeader.CreateTime
if !bypassAdmission && createTime == 0 {
// TODO(sumeer): revisit this for multi-tenant. Specifically, the SQL use
Expand Down
14 changes: 14 additions & 0 deletions pkg/util/admission/work_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ var KVAdmissionControlEnabled = settings.RegisterBoolSetting(
"when true, work performed by the KV layer is subject to admission control",
true).WithPublic()

// KVBulkOnlyAdmissionControlEnabled controls whether user (normal and above
// priority) work is subject to admission control. If it is set to true, then
// user work will not be throttled by admission control but bulk work still will
// be. This setting is a preferable alternative to completely disabling
// admission control. It can be used reactively in cases where index backfill,
// schema modifications or other bulk operations are causing high latency due to
// io_overload on nodes.
// TODO(baptist): Find a better solution to this in v23.1.
var KVBulkOnlyAdmissionControlEnabled = settings.RegisterBoolSetting(
settings.SystemOnly,
"admission.kv.bulk_only.enabled",
"when both admission.kv.enabled and this is true, only throttle bulk work",
false)

// SQLKVResponseAdmissionControlEnabled controls whether response processing
// in SQL, for KV requests, is enabled.
var SQLKVResponseAdmissionControlEnabled = settings.RegisterBoolSetting(
Expand Down

0 comments on commit c8c8535

Please sign in to comment.