Skip to content

Commit 0e74277

Browse files
committed
Parameterized queue length in GetMappedRange test
Also retry when operation_cancelled happens
1 parent 4537535 commit 0e74277

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

fdbserver/workloads/GetMappedRange.actor.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ struct GetMappedRangeWorkload : ApiWorkload {
5151
const bool SPLIT_RECORDS = true;
5252
const static int SPLIT_SIZE = 3;
5353
int checkStorageQueueSeconds;
54+
int queueMaxLength;
5455

5556
GetMappedRangeWorkload(WorkloadContext const& wcx) : ApiWorkload(wcx) {
5657
enabled = !clientId; // only do this on the "first" client
57-
checkStorageQueueSeconds = getOption(options, "checkStorageQueueSeconds"_sr, 30.0);
58+
checkStorageQueueSeconds = getOption(options, "checkStorageQueueSeconds"_sr, 60.0);
59+
queueMaxLength = getOption(options, "queueMaxLength"_sr, 100);
5860
}
5961

6062
std::string description() const override { return "GetMappedRange"; }
@@ -251,7 +253,8 @@ struct GetMappedRangeWorkload : ApiWorkload {
251253
e.code() == error_code_quick_get_key_values_miss)) {
252254
TraceEvent("GetMappedRangeWorkloadExpectedErrorDetected").error(e);
253255
return MappedRangeResult();
254-
} else if (e.code() == error_code_proxy_memory_limit_exceeded) {
256+
} else if (e.code() == error_code_proxy_memory_limit_exceeded ||
257+
e.code() == error_code_operation_cancelled) {
255258
// requests have overwhelmed commit proxy, rest a bit
256259
wait(delay(FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY));
257260
continue;
@@ -446,8 +449,8 @@ struct GetMappedRangeWorkload : ApiWorkload {
446449
if (role["role"].get_str() == "storage") {
447450
role.get("query_queue_max", queryQueueMax);
448451
TEST(queryQueueMax > 0); // SS query queue is non-empty
449-
ASSERT(queryQueueMax < 100); // if the queue size metric is wrong, it is likely above 100
450452
TraceEvent(SevDebug, "QueryQueueMax").detail("Value", queryQueueMax);
453+
ASSERT(queryQueueMax < self->queueMaxLength);
451454
}
452455
}
453456
} else {

tests/fast/GetMappedRange.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ useDB = true
44

55
[[test.workload]]
66
testName = 'GetMappedRange'
7-
checkStorageQueueSeconds=60
7+
checkStorageQueueSeconds=60
8+
queueMaxLength=100

0 commit comments

Comments
 (0)