Fix off by one error

Epoch end version is saved version + 1, so need +1 for minBackupVersion.
This commit is contained in:
Jingyu Zhou 2020-03-23 20:44:31 -07:00
parent f1d7fbafb4
commit 243d078596
1 changed files with 2 additions and 1 deletions

View File

@ -1316,12 +1316,13 @@ ACTOR static Future<Void> recruitBackupWorkers(Reference<MasterData> self, Datab
state Future<Optional<Version>> fMinVersion = getMinBackupVersion(self, cx);
wait(gotProgress && success(fMinVersion));
TraceEvent("MinBackupVersion", self->dbgid).detail("Version", fMinVersion.get().present() ? fMinVersion.get() : -1);
std::map<std::tuple<LogEpoch, Version, int>, std::map<Tag, Version>> toRecruit =
backupProgress->getUnfinishedBackup();
for (const auto& [epochVersionTags, tagVersions] : toRecruit) {
const Version oldEpochEnd = std::get<1>(epochVersionTags);
if (!fMinVersion.get().present() || fMinVersion.get().get() >= oldEpochEnd) {
if (!fMinVersion.get().present() || fMinVersion.get().get() + 1 >= oldEpochEnd) {
TraceEvent("SkipBackupRecruitment", self->dbgid)
.detail("MinVersion", fMinVersion.get().get())
.detail("Epoch", epoch)