diff --git a/fdbserver/workloads/LowLatency.actor.cpp b/fdbserver/workloads/LowLatency.actor.cpp index d5468933a7..f9d807f095 100644 --- a/fdbserver/workloads/LowLatency.actor.cpp +++ b/fdbserver/workloads/LowLatency.actor.cpp @@ -28,7 +28,8 @@ struct LowLatencyWorkload : TestWorkload { double testDuration; - double maxLatency; + double maxGRVLatency; + double maxCommitLatency; double checkDelay; PerfIntCounter operations, retries; bool testWrites; @@ -39,7 +40,8 @@ struct LowLatencyWorkload : TestWorkload { : TestWorkload(wcx), operations("Operations"), retries("Retries") , ok(true) { testDuration = getOption( options, LiteralStringRef("testDuration"), 600.0 ); - maxLatency = getOption( options, LiteralStringRef("maxLatency"), 20.0 ); + maxGRVLatency = getOption(options, LiteralStringRef("maxGRVLatency"), 20.0); + maxCommitLatency = getOption(options, LiteralStringRef("maxCommitLatency"), 30.0); checkDelay = getOption( options, LiteralStringRef("checkDelay"), 1.0 ); testWrites = getOption(options, LiteralStringRef("testWrites"), true); testKey = getOption(options, LiteralStringRef("testKey"), LiteralStringRef("testKey")); @@ -64,13 +66,14 @@ struct LowLatencyWorkload : TestWorkload { wait( delay( self->checkDelay ) ); state Transaction tr( cx ); state double operationStart = now(); + state bool doCommit = self->testWrites && deterministicRandom()->coinflip(); + state double maxLatency = doCommit ? self->maxCommitLatency : self->maxGRVLatency; ++self->operations; loop { try { tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE); tr.setOption(FDBTransactionOptions::LOCK_AWARE); - bool doSet = self->testWrites && deterministicRandom()->coinflip(); - if (doSet) { + if (doCommit) { tr.set(self->testKey, LiteralStringRef("")); wait(tr.commit()); } else { @@ -82,8 +85,11 @@ struct LowLatencyWorkload : TestWorkload { ++self->retries; } } - if(now() - operationStart > self->maxLatency) { - TraceEvent(SevError, "LatencyTooLarge").detail("MaxLatency", self->maxLatency).detail("ObservedLatency", now() - operationStart); + if (now() - operationStart > maxLatency) { + TraceEvent(SevError, "LatencyTooLarge") + .detail("MaxLatency", maxLatency) + .detail("ObservedLatency", now() - operationStart) + .detail("IsCommit", doCommit); self->ok = false; } if( now() - testStart > self->testDuration ) diff --git a/tests/slow/LowLatencyWithFailures.txt b/tests/slow/LowLatencyWithFailures.txt index 305e900b0f..2cc74262b5 100644 --- a/tests/slow/LowLatencyWithFailures.txt +++ b/tests/slow/LowLatencyWithFailures.txt @@ -6,7 +6,8 @@ testTitle=Clogged testName=LowLatency testDuration=300.0 - maxLatency=50.0 + maxGRVLatency=50.0 + testWrites=false testName=Attrition machinesToKill=1 @@ -18,4 +19,4 @@ testTitle=Clogged killDc=false connectionFailuresDisableDuration=60 -minimumReplication=2 \ No newline at end of file +minimumReplication=2