Some correctness fixes
This commit is contained in:
parent
5ce9fc0e4c
commit
fe6b4a4398
|
@ -1271,13 +1271,17 @@ std::cout << "Return end = " << end << "\n\n";
|
|||
if (partitioned) {
|
||||
// sort by tag ID so that filterDuplicates works.
|
||||
std::sort(logs.begin(), logs.end(), [](const LogFile& a, const LogFile& b) {
|
||||
return a.tagId < b.tagId || a.beginVersion < b.beginVersion || a.endVersion < b.endVersion;
|
||||
return a.tagId == b.tagId ? (a.beginVersion == b.beginVersion ? a.endVersion < b.endVersion
|
||||
: a.beginVersion < b.beginVersion)
|
||||
: (a.tagId < b.tagId);
|
||||
});
|
||||
|
||||
// Remove duplicated log files that can happen for old epochs.
|
||||
std::vector<LogFile> filtered = filterDuplicates(logs);
|
||||
|
||||
restorable.logs.swap(filtered);
|
||||
// sort by version order again for continuous analysis
|
||||
std::sort(restorable.logs.begin(), restorable.logs.end());
|
||||
if (isPartitionedLogsContinuous(restorable.logs, snapshot.get().beginVersion, targetVersion)) {
|
||||
return Optional<RestorableFileSet>(restorable);
|
||||
}
|
||||
|
|
|
@ -75,7 +75,8 @@ std::map<std::tuple<LogEpoch, Version, int>, std::map<Tag, Version>> BackupProgr
|
|||
}
|
||||
}
|
||||
if (savedMore > 0) {
|
||||
ASSERT(info.logRouterTags == rit->second.size()); // Same number as logRouterTags
|
||||
// TODO: check the logRouterTags are the same
|
||||
// ASSERT(info.logRouterTags == rit->second.size());
|
||||
|
||||
updateTagVersions(&tagVersions, &tags, rit->second, info.epochEnd, epoch);
|
||||
}
|
||||
|
|
|
@ -454,7 +454,7 @@ ACTOR Future<Void> saveMutationsToFile(BackupData* self, Version popVersion, int
|
|||
}
|
||||
|
||||
for (auto it = self->backups.begin(); it != self->backups.end();) {
|
||||
if (!it->second.container.get().present()) {
|
||||
if (it->second.stopped || !it->second.container.get().present()) {
|
||||
TraceEvent("BackupWorkerNoContainer", self->myId).detail("BackupId", it->first);
|
||||
it = self->backups.erase(it);
|
||||
continue;
|
||||
|
@ -566,7 +566,7 @@ ACTOR Future<Void> uploadData(BackupData* self) {
|
|||
if (self->pullFinished()) {
|
||||
popVersion = self->endVersion.get();
|
||||
}
|
||||
if (numMsg > 0 || (popVersion > lastPopVersion && self->pulling) || self->pullFinished()) {
|
||||
if (((numMsg > 0 || popVersion > lastPopVersion) && self->pulling) || self->pullFinished()) {
|
||||
TraceEvent("BackupWorkerSave", self->myId)
|
||||
.detail("Version", popVersion)
|
||||
.detail("MsgQ", self->messages.size());
|
||||
|
@ -575,6 +575,8 @@ ACTOR Future<Void> uploadData(BackupData* self) {
|
|||
self->messages.erase(self->messages.begin(), self->messages.begin() + numMsg);
|
||||
}
|
||||
|
||||
// If transition into NOOP mode, should clear messages
|
||||
|
||||
if (popVersion > self->savedVersion) {
|
||||
wait(saveProgress(self, popVersion));
|
||||
TraceEvent("BackupWorkerSavedProgress", self->myId)
|
||||
|
|
Loading…
Reference in New Issue