Relax commit latency requirement for LowLatency workload
This commit is contained in:
parent
e6c8cc0eff
commit
d0189ad0d4
|
@ -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 )
|
||||
|
|
|
@ -6,7 +6,8 @@ testTitle=Clogged
|
|||
|
||||
testName=LowLatency
|
||||
testDuration=300.0
|
||||
maxLatency=50.0
|
||||
maxGRVLatency=50.0
|
||||
testWrites=false
|
||||
|
||||
testName=Attrition
|
||||
machinesToKill=1
|
||||
|
|
Loading…
Reference in New Issue