Fix non-deterministic error
This commit is contained in:
parent
3310f67e9e
commit
6b07c271f1
|
@ -84,6 +84,7 @@ struct RestoreLoaderData : RestoreRoleData, public ReferenceCounted<RestoreLoade
|
||||||
numSampledMutations = 0;
|
numSampledMutations = 0;
|
||||||
processedFileParams.clear();
|
processedFileParams.clear();
|
||||||
kvOpsPerLP.clear();
|
kvOpsPerLP.clear();
|
||||||
|
sampleMutations.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only get the appliers that are responsible for a range
|
// Only get the appliers that are responsible for a range
|
||||||
|
|
|
@ -364,12 +364,14 @@ void splitKeyRangeForAppliers(Reference<RestoreMasterData> self) {
|
||||||
std::vector<Key> keyrangeSplitter;
|
std::vector<Key> keyrangeSplitter;
|
||||||
keyrangeSplitter.push_back(normalKeys.begin); // First slot
|
keyrangeSplitter.push_back(normalKeys.begin); // First slot
|
||||||
double cumulativeSize = slotSize;
|
double cumulativeSize = slotSize;
|
||||||
|
TraceEvent("FastRestore").detail("VersionBatch", self->batchIndex).detail("SamplingSize", self->samplesSize);
|
||||||
while (cumulativeSize < self->samplesSize) {
|
while (cumulativeSize < self->samplesSize) {
|
||||||
IndexedSet<Key, int64_t>::iterator lowerBound = self->samples.index(cumulativeSize);
|
IndexedSet<Key, int64_t>::iterator lowerBound = self->samples.index(cumulativeSize);
|
||||||
if (lowerBound == self->samples.end()) {
|
if (lowerBound == self->samples.end()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
keyrangeSplitter.push_back(*lowerBound);
|
keyrangeSplitter.push_back(*lowerBound);
|
||||||
|
TraceEvent("FastRestore").detail("VersionBatch", self->batchIndex).detail("CumulativeSize", cumulativeSize).detail("SlotSize", slotSize);
|
||||||
cumulativeSize += slotSize;
|
cumulativeSize += slotSize;
|
||||||
}
|
}
|
||||||
if (keyrangeSplitter.size() < numAppliers) {
|
if (keyrangeSplitter.size() < numAppliers) {
|
||||||
|
@ -491,6 +493,8 @@ ACTOR static Future<Void> initializeVersionBatch(Reference<RestoreMasterData> se
|
||||||
}
|
}
|
||||||
wait(sendBatchRequests(&RestoreLoaderInterface::initVersionBatch, self->loadersInterf, requestsToLoaders));
|
wait(sendBatchRequests(&RestoreLoaderInterface::initVersionBatch, self->loadersInterf, requestsToLoaders));
|
||||||
|
|
||||||
|
self->resetPerVersionBatch();
|
||||||
|
|
||||||
return Void();
|
return Void();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ struct RestoreMasterData : RestoreRoleData, public ReferenceCounted<RestoreMaste
|
||||||
~RestoreMasterData() = default;
|
~RestoreMasterData() = default;
|
||||||
|
|
||||||
void resetPerVersionBatch() {
|
void resetPerVersionBatch() {
|
||||||
|
TraceEvent("FastRestore").detail("RestoreMaster", "ResetPerVersionBatch").detail("VersionBatchIndex", batchIndex);
|
||||||
samplesSize = 0;
|
samplesSize = 0;
|
||||||
samples.clear();
|
samples.clear();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue