A couple workload improvements
This commit is contained in:
parent
74c8167745
commit
bf6ed8348f
|
@ -1547,15 +1547,13 @@ ACTOR Future<Void> recoverBlobManager(Reference<BlobManagerData> bmData) {
|
||||||
bmData->knownBlobRanges.insert(KeyRangeRef(granuleStartKey, granuleEndKey), true);
|
bmData->knownBlobRanges.insert(KeyRangeRef(granuleStartKey, granuleEndKey), true);
|
||||||
if (BM_DEBUG) {
|
if (BM_DEBUG) {
|
||||||
fmt::print(" [{0} - {1})={2}\n",
|
fmt::print(" [{0} - {1})={2}\n",
|
||||||
results[rangeIdx].key.printable(),
|
granuleStartKey.printable(),
|
||||||
results[rangeIdx + 1].key.printable(),
|
granuleEndKey.printable(),
|
||||||
results[rangeIdx].value.printable());
|
results[rangeIdx].value.printable());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (BM_DEBUG) {
|
if (BM_DEBUG) {
|
||||||
fmt::print(" [{0} - {1})\n",
|
fmt::print(" [{0} - {1})\n", granuleStartKey.printable(), granuleEndKey.printable());
|
||||||
results[rangeIdx].key.printable(),
|
|
||||||
results[rangeIdx + 1].key.printable());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -543,10 +543,10 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
|
||||||
state double last = now();
|
state double last = now();
|
||||||
state double targetBytesReadPerQuery =
|
state double targetBytesReadPerQuery =
|
||||||
SERVER_KNOBS->BG_SNAPSHOT_FILE_TARGET_BYTES * 2.0 / deterministicRandom()->randomInt(1, 11);
|
SERVER_KNOBS->BG_SNAPSHOT_FILE_TARGET_BYTES * 2.0 / deterministicRandom()->randomInt(1, 11);
|
||||||
state int targetKeysReadPerQuery =
|
|
||||||
(int)(targetBytesReadPerQuery / (threadData->targetValLength * threadData->targetIDsPerKey));
|
// read at higher read rate than write rate to validate data
|
||||||
// read at higher read rate than write rate
|
state double targetReadBytesPerSec = threadData->targetByteRate * 4;
|
||||||
state double targetTps = threadData->targetByteRate * 2 / targetBytesReadPerQuery;
|
ASSERT(targetReadBytesPerSec > 0);
|
||||||
|
|
||||||
state Version readVersion;
|
state Version readVersion;
|
||||||
|
|
||||||
|
@ -574,8 +574,13 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
|
||||||
auto endKeyIt = threadData->keyData.find(startKey);
|
auto endKeyIt = threadData->keyData.find(startKey);
|
||||||
ASSERT(endKeyIt != threadData->keyData.end());
|
ASSERT(endKeyIt != threadData->keyData.end());
|
||||||
|
|
||||||
for (int i = 0; i < targetKeysReadPerQuery && endKeyIt != threadData->keyData.end(); i++, endKeyIt++) {
|
int targetQueryBytes = (deterministicRandom()->randomInt(1, 20) * targetBytesReadPerQuery) / 10;
|
||||||
|
int estimatedQueryBytes = 0;
|
||||||
|
for (int i = 0; estimatedQueryBytes < targetQueryBytes && endKeyIt != threadData->keyData.end();
|
||||||
|
i++, endKeyIt++) {
|
||||||
// iterate forward until end or target keys have passed
|
// iterate forward until end or target keys have passed
|
||||||
|
estimatedQueryBytes += (1 + endKeyIt->second.writes.size() - endKeyIt->second.nextClearIdx) *
|
||||||
|
threadData->targetValLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
state uint32_t endKey;
|
state uint32_t endKey;
|
||||||
|
@ -609,8 +614,11 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
|
||||||
wait(self->readFromBlob(cx, self, range, readVersion));
|
wait(self->readFromBlob(cx, self, range, readVersion));
|
||||||
self->validateResult(threadData, blob, startKey, endKey, 0, readVersion);
|
self->validateResult(threadData, blob, startKey, endKey, 0, readVersion);
|
||||||
|
|
||||||
|
int resultBytes = blob.first.expectedSize();
|
||||||
threadData->rowsRead += blob.first.size();
|
threadData->rowsRead += blob.first.size();
|
||||||
threadData->bytesRead += blob.first.expectedSize();
|
threadData->bytesRead += resultBytes;
|
||||||
|
|
||||||
|
wait(poisson(&last, (resultBytes + 1) / targetReadBytesPerSec));
|
||||||
} catch (Error& e) {
|
} catch (Error& e) {
|
||||||
if (e.code() == error_code_operation_cancelled) {
|
if (e.code() == error_code_operation_cancelled) {
|
||||||
throw;
|
throw;
|
||||||
|
@ -624,7 +632,6 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wait(poisson(&last, 1.0 / targetTps));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ testTitle = 'BlobGranuleVerifySmall'
|
||||||
[[test.workload]]
|
[[test.workload]]
|
||||||
testName = 'WriteDuringRead'
|
testName = 'WriteDuringRead'
|
||||||
testDuration = 120.0
|
testDuration = 120.0
|
||||||
|
useSystemKeys = false
|
||||||
|
|
||||||
[[test.workload]]
|
[[test.workload]]
|
||||||
testName = 'BlobGranuleVerifier'
|
testName = 'BlobGranuleVerifier'
|
||||||
|
|
|
@ -7,6 +7,7 @@ testTitle = 'BlobGranuleVerifySmallClean'
|
||||||
[[test.workload]]
|
[[test.workload]]
|
||||||
testName = 'WriteDuringRead'
|
testName = 'WriteDuringRead'
|
||||||
testDuration = 120.0
|
testDuration = 120.0
|
||||||
|
useSystemKeys = false
|
||||||
|
|
||||||
[[test.workload]]
|
[[test.workload]]
|
||||||
testName = 'BlobGranuleVerifier'
|
testName = 'BlobGranuleVerifier'
|
||||||
|
|
Loading…
Reference in New Issue