Skip to content

Commit 5de62d6

Browse files
authored
Merge pull request #153360 from cockroachdb/blathers/backport-release-25.3-153206
2 parents aaf571c + b9d5aa1 commit 5de62d6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pkg/cmd/roachtest/tests/admission_control_disk_bandwidth_overload.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func registerDiskBandwidthOverload(r registry.Registry) {
7474
staller := roachtestutil.MakeCgroupDiskStaller(t, c,
7575
false /* readsToo */, false /* logsToo */)
7676
staller.Setup(ctx)
77-
staller.Slow(ctx, c.CRDBNodes(), provisionedBandwidth)
77+
staller.Slow(ctx, c.CRDBNodes(), provisionedBandwidth /* bytesPerSecond */)
7878

7979
// TODO(aaditya): Extend this test to also limit reads once we have a
8080
// mechanism to pace read traffic in AC.
@@ -135,11 +135,11 @@ func registerDiskBandwidthOverload(r registry.Registry) {
135135
db := c.Conn(ctx, t.L(), len(c.CRDBNodes()))
136136
defer db.Close()
137137

138-
const bandwidthLimit = 75
138+
const bandwidthLimitMbs = 75
139139
if _, err := db.ExecContext(
140140
// We intentionally set this to much lower than the provisioned value
141141
// above to clearly show that the bandwidth limiter works.
142-
ctx, fmt.Sprintf("SET CLUSTER SETTING kvadmission.store.provisioned_bandwidth = '%dMiB'", bandwidthLimit)); err != nil {
142+
ctx, fmt.Sprintf("SET CLUSTER SETTING kvadmission.store.provisioned_bandwidth = '%dMiB'", bandwidthLimitMbs)); err != nil {
143143
t.Fatalf("failed to set kvadmission.store.provisioned_bandwidth: %v", err)
144144
}
145145

@@ -172,7 +172,7 @@ func registerDiskBandwidthOverload(r registry.Registry) {
172172
}
173173

174174
// Allow a 5% room for error.
175-
const bandwidthThreshold = bandwidthLimit * 1.05
175+
const bandwidthThreshold = bandwidthLimitMbs * 1.05
176176
const sampleCountForBW = 12
177177
const collectionIntervalSeconds = 10.0
178178
// Loop for ~20 minutes.

pkg/cmd/roachtest/tests/admission_control_snapshot_overload_io.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ func runAdmissionControlSnapshotOverloadIO(
172172

173173
// Now set disk bandwidth limits
174174
if cfg.limitDiskBandwidth {
175-
const bandwidthLimit = 128 << 20 // 128 MiB
176-
t.Status(fmt.Sprintf("limiting disk bandwidth to %d bytes/s", bandwidthLimit))
175+
const bandwidthLimitMbs = 128
176+
t.Status(fmt.Sprintf("limiting disk bandwidth to %d MB/s", bandwidthLimitMbs))
177177
staller := roachtestutil.MakeCgroupDiskStaller(t, c,
178178
false /* readsToo */, false /* logsToo */)
179179
staller.Setup(ctx)
180-
staller.Slow(ctx, c.CRDBNodes(), bandwidthLimit)
180+
staller.Slow(ctx, c.CRDBNodes(), bandwidthLimitMbs<<20 /* bytesPerSecond */)
181181

182182
if _, err := db.ExecContext(
183-
ctx, fmt.Sprintf("SET CLUSTER SETTING kvadmission.store.provisioned_bandwidth = '%dMiB'", bandwidthLimit)); err != nil {
183+
ctx, fmt.Sprintf("SET CLUSTER SETTING kvadmission.store.provisioned_bandwidth = '%dMiB'", bandwidthLimitMbs)); err != nil {
184184
t.Fatalf("failed to set kvadmission.store.provisioned_bandwidth: %v", err)
185185
}
186186
if _, err := db.ExecContext(

0 commit comments

Comments
 (0)