Skip to content

Commit 7a2701e

Browse files
Backup unit test fix. (#12102)
1 parent ef7448b commit 7a2701e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fdbclient/BackupContainerFileSystem.actor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,7 +2283,7 @@ ACTOR Future<Void> testBackupContainerWithMissingLogRanges(std::string url, Opti
22832283
state Version logEnd = v;
22842284
state Version snapshotBeginVersion = v;
22852285
state Version snapshotEndVersion = v;
2286-
state bool nextSnapshotMissingLogs = false;
2286+
state Version lastMissedLogFileEnd = 0;
22872287

22882288
// create a random number of snapshots
22892289
state int numSnapshots = deterministicRandom()->randomInt(1, 10);
@@ -2312,8 +2312,9 @@ ACTOR Future<Void> testBackupContainerWithMissingLogRanges(std::string url, Opti
23122312
deterministicRandom()->randomInt(0, 2e6),
23132313
IncludeKeyRangeMap(BUGGIFY)));
23142314

2315-
snapshotsMissingLogs.push_back(nextSnapshotMissingLogs);
2316-
nextSnapshotMissingLogs = false;
2315+
// if the last missing log file overlaps with the current snapshot,
2316+
// mark snapshotsMissingLogs for current snapshot as true.
2317+
snapshotsMissingLogs.push_back(lastMissedLogFileEnd > snapshotBeginVersion);
23172318

23182319
// creating log files for the snapshot range.
23192320
while (logStart < logEnd) {
@@ -2325,8 +2326,7 @@ ACTOR Future<Void> testBackupContainerWithMissingLogRanges(std::string url, Opti
23252326
// If the missing log range falls in the current snapshot range, mark it.
23262327
if (!(tempLogEnd < snapshotBeginVersion || snapshotEndVersion < logStart))
23272328
snapshotsMissingLogs.back() = true;
2328-
if (tempLogEnd > v) // if it overlaps with the next snapshot, mark the next snapshot as well.
2329-
nextSnapshotMissingLogs = true;
2329+
lastMissedLogFileEnd = tempLogEnd;
23302330
}
23312331
logStart = tempLogEnd;
23322332
}

0 commit comments

Comments
 (0)