Skip to content

Commit

Permalink
Merge #132864
Browse files Browse the repository at this point in the history
132864: admission: fix snapshot queue bug, returning item to wrong pool  r=sumeerbhola a=aadityasondhi

PR includes two commits:

----
[admission: fix snapshot queue bug, returning item to wrong pool](fad053c) 

Fixes #132534.

Release note: None

----

[admission: make snapshot ingest AC setting metamorphic for tests](a515b3c) 

Part of: [CRDB-36837](https://cockroachlabs.atlassian.net/browse/CRDB-36837)

Release note: None

Co-authored-by: Aaditya Sondhi <[email protected]>
  • Loading branch information
craig[bot] and aadityasondhi committed Oct 17, 2024
2 parents f38e635 + 989427c commit b2e1d9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/util/admission/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ go_library(
"//pkg/util/grunning",
"//pkg/util/humanizeutil",
"//pkg/util/log",
"//pkg/util/metamorphic",
"//pkg/util/metric",
"//pkg/util/queue",
"//pkg/util/schedulerlatency",
Expand Down
8 changes: 5 additions & 3 deletions pkg/util/admission/snapshot_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/settings"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/metamorphic"
"github.com/cockroachdb/cockroach/pkg/util/metric"
"github.com/cockroachdb/cockroach/pkg/util/queue"
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
Expand Down Expand Up @@ -51,8 +52,9 @@ var DiskBandwidthForSnapshotIngest = settings.RegisterBoolSetting(
settings.SystemOnly, "kvadmission.store.snapshot_ingest_bandwidth_control.enabled",
"if set to true, snapshot ingests will be subject to disk write control in AC",
// TODO(aaditya): Enable by default once enough experimentation is done.
false,
settings.WithPublic)
metamorphic.ConstantWithTestBool("kvadmission.store.snapshot_ingest_bandwidth_control.enabled", false),
settings.WithPublic,
)

var snapshotWaitDur = metric.Metadata{
Name: "admission.wait_durations.snapshot_ingest",
Expand Down Expand Up @@ -240,7 +242,7 @@ func releaseSnapshotWorkItem(sw *snapshotWorkItem) {
*sw = snapshotWorkItem{
admitCh: ch,
}
waitingWorkPool.Put(sw)
snapshotWorkItemPool.Put(sw)
}

func newSnapshotWorkItem(count int64) *snapshotWorkItem {
Expand Down

0 comments on commit b2e1d9a

Please sign in to comment.