Fixing final check bug in new workload
This commit is contained in:
parent
14cc0a8b02
commit
005421dfc8
|
@ -450,9 +450,6 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
|
||||||
"DBG READ: Skip ID {0} cleared @ {1}\n", idIdx, checkIt->second.writes[idIdx].clearVersion);
|
"DBG READ: Skip ID {0} cleared @ {1}\n", idIdx, checkIt->second.writes[idIdx].clearVersion);
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
if (DEBUG_READ_OP(threadData->directoryID, readVersion)) {
|
|
||||||
printf("Finished skipping\n");
|
|
||||||
}
|
|
||||||
for (; idIdx < checkIt->second.writes.size() && checkIt->second.writes[idIdx].writeVersion <= readVersion;
|
for (; idIdx < checkIt->second.writes.size() && checkIt->second.writes[idIdx].writeVersion <= readVersion;
|
||||||
idIdx++) {
|
idIdx++) {
|
||||||
Key nextKeyShouldBe = threadData->getKey(key, idIdx);
|
Key nextKeyShouldBe = threadData->getKey(key, idIdx);
|
||||||
|
@ -724,6 +721,7 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
|
||||||
uint32_t id = std::get<1>(it);
|
uint32_t id = std::get<1>(it);
|
||||||
auto keyIt = threadData->keyData.find(key);
|
auto keyIt = threadData->keyData.find(key);
|
||||||
ASSERT(keyIt != threadData->keyData.end());
|
ASSERT(keyIt != threadData->keyData.end());
|
||||||
|
|
||||||
keyIt->second.writes[id].writeVersion = commitVersion;
|
keyIt->second.writes[id].writeVersion = commitVersion;
|
||||||
if (DEBUG_KEY_OP(threadData->directoryID, key)) {
|
if (DEBUG_KEY_OP(threadData->directoryID, key)) {
|
||||||
fmt::print("DBG: {0} WRITE {1} = {2}:{3}\n",
|
fmt::print("DBG: {0} WRITE {1} = {2}:{3}\n",
|
||||||
|
@ -774,21 +772,18 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
|
||||||
|
|
||||||
state bool result = true;
|
state bool result = true;
|
||||||
state int finalRowsValidated;
|
state int finalRowsValidated;
|
||||||
if (threadData->minSuccessfulReadVersion == MAX_VERSION) {
|
if (threadData->writeVersions.size()) {
|
||||||
// never had a successful read during the test, likely due to many chaos events. Just wait for granules to
|
// never had a successful write during the test, likely due to many chaos events. Just wait for granules to
|
||||||
// become available and call that a pass, since writer is stopped
|
// become available and call that a pass, since writer is stopped and will never guarantee anything is
|
||||||
|
// written
|
||||||
|
if (BGW_DEBUG) {
|
||||||
|
fmt::print("Directory {0} doing final availability check\n", threadData->directoryID);
|
||||||
|
}
|
||||||
wait(self->waitFirstSnapshot(self, cx, threadData, false));
|
wait(self->waitFirstSnapshot(self, cx, threadData, false));
|
||||||
} else {
|
} else {
|
||||||
// otherwise, read at last write version and ensure everything becomes available and matches
|
// otherwise, read at last write version and ensure everything becomes available and matches
|
||||||
// it's possible that waitFirstSnapshot finished but then writer never wrote anything before test timed out
|
// it's possible that waitFirstSnapshot finished but then writer never wrote anything before test timed out
|
||||||
state Version readVersion;
|
state Version readVersion = threadData->writeVersions.back();
|
||||||
if (threadData->writeVersions.size()) {
|
|
||||||
readVersion = threadData->writeVersions.back();
|
|
||||||
} else {
|
|
||||||
state Transaction tr(cx);
|
|
||||||
Version rv = wait(self->doGrv(&tr));
|
|
||||||
readVersion = rv;
|
|
||||||
}
|
|
||||||
if (BGW_DEBUG) {
|
if (BGW_DEBUG) {
|
||||||
fmt::print("Directory {0} doing final data check @ {1}\n", threadData->directoryID, readVersion);
|
fmt::print("Directory {0} doing final data check @ {1}\n", threadData->directoryID, readVersion);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue