A couple workload improvements

This commit is contained in:
Josh Slocum 2022-01-27 10:26:21 -06:00
parent 74c8167745
commit bf6ed8348f
4 changed files with 19 additions and 12 deletions

View File

@ -1547,15 +1547,13 @@ ACTOR Future<Void> recoverBlobManager(Reference<BlobManagerData> bmData) {
bmData->knownBlobRanges.insert(KeyRangeRef(granuleStartKey, granuleEndKey), true);
if (BM_DEBUG) {
fmt::print(" [{0} - {1})={2}\n",
results[rangeIdx].key.printable(),
results[rangeIdx + 1].key.printable(),
granuleStartKey.printable(),
granuleEndKey.printable(),
results[rangeIdx].value.printable());
}
} else {
if (BM_DEBUG) {
fmt::print(" [{0} - {1})\n",
results[rangeIdx].key.printable(),
results[rangeIdx + 1].key.printable());
fmt::print(" [{0} - {1})\n", granuleStartKey.printable(), granuleEndKey.printable());
}
}
}

View File

@ -543,10 +543,10 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
state double last = now();
state double targetBytesReadPerQuery =
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
state double targetTps = threadData->targetByteRate * 2 / targetBytesReadPerQuery;
// read at higher read rate than write rate to validate data
state double targetReadBytesPerSec = threadData->targetByteRate * 4;
ASSERT(targetReadBytesPerSec > 0);
state Version readVersion;
@ -574,8 +574,13 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
auto endKeyIt = threadData->keyData.find(startKey);
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
estimatedQueryBytes += (1 + endKeyIt->second.writes.size() - endKeyIt->second.nextClearIdx) *
threadData->targetValLength;
}
state uint32_t endKey;
@ -609,8 +614,11 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
wait(self->readFromBlob(cx, self, range, readVersion));
self->validateResult(threadData, blob, startKey, endKey, 0, readVersion);
int resultBytes = blob.first.expectedSize();
threadData->rowsRead += blob.first.size();
threadData->bytesRead += blob.first.expectedSize();
threadData->bytesRead += resultBytes;
wait(poisson(&last, (resultBytes + 1) / targetReadBytesPerSec));
} catch (Error& e) {
if (e.code() == error_code_operation_cancelled) {
throw;
@ -624,7 +632,6 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
}
}
}
wait(poisson(&last, 1.0 / targetTps));
}
}

View File

@ -7,6 +7,7 @@ testTitle = 'BlobGranuleVerifySmall'
[[test.workload]]
testName = 'WriteDuringRead'
testDuration = 120.0
useSystemKeys = false
[[test.workload]]
testName = 'BlobGranuleVerifier'

View File

@ -7,6 +7,7 @@ testTitle = 'BlobGranuleVerifySmallClean'
[[test.workload]]
testName = 'WriteDuringRead'
testDuration = 120.0
useSystemKeys = false
[[test.workload]]
testName = 'BlobGranuleVerifier'