Skip to content

Commit

Permalink
Merge pull request #119173 from sumeerbhola/ac_bulk_only
Browse files Browse the repository at this point in the history
admission,kvadmission: scope admission.kv.bulk_only.enabled to store …
  • Loading branch information
sumeerbhola authored Mar 8, 2024
2 parents cc8d12d + 9d528a4 commit 5861f17
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 6 additions & 2 deletions pkg/kv/kvserver/kvadmission/kvadmission.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,12 @@ func (n *controllerImpl) AdmitKVWork(
if source == kvpb.AdmissionHeader_OTHER {
bypassAdmission = true
}
// bypassAdmission => bypassStoreAdmission.
bypassStoreAdmission := bypassAdmission
// 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
bypassStoreAdmission = true
}
}
createTime := ba.AdmissionHeader.CreateTime
Expand All @@ -278,8 +280,10 @@ func (n *controllerImpl) AdmitKVWork(
if ba.IsWrite() && !ba.IsSingleHeartbeatTxnRequest() {
storeAdmissionQ := n.storeGrantCoords.TryGetQueueForStore(int32(ba.Replica.StoreID))
if storeAdmissionQ != nil {
storeAdmissionInfo := admissionInfo
storeAdmissionInfo.BypassAdmission = bypassStoreAdmission
storeWorkHandle, err := storeAdmissionQ.Admit(
ctx, admission.StoreWriteWorkInfo{WorkInfo: admissionInfo})
ctx, admission.StoreWriteWorkInfo{WorkInfo: storeAdmissionInfo})
if err != nil {
return Handle{}, err
}
Expand Down
13 changes: 7 additions & 6 deletions pkg/util/admission/work_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ var KVAdmissionControlEnabled = settings.RegisterBoolSetting(
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.
// priority) work is subject to store admission control. If it is set to true,
// then user work will not be throttled by store 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 overload on stores.
//
// TODO(baptist): Find a better solution to this in v23.1.
var KVBulkOnlyAdmissionControlEnabled = settings.RegisterBoolSetting(
settings.SystemOnly,
Expand Down

0 comments on commit 5861f17

Please sign in to comment.