fixing off by one (#8279)

This commit is contained in:
Josh Slocum 2022-09-22 18:31:55 -05:00 committed by GitHub
parent f78eb8c778
commit 9122e6e5fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -2437,10 +2437,13 @@ ACTOR Future<Void> blobGranuleUpdateFiles(Reference<BlobWorkerData> bwData,
previousFuture = Future<BlobFileIndex>(BlobFileIndex());
}
// The last version included in the old change feed is startState.cfStartVersion - 1.
// So if the previous delta file did not include this version, and the new delta file does, the old
// change feed is considered complete.
Optional<std::pair<KeyRange, UID>> oldChangeFeedDataComplete;
if (startState.splitParentGranule.present() &&
metadata->pendingDeltaVersion < startState.changeFeedStartVersion &&
lastDeltaVersion >= startState.changeFeedStartVersion) {
metadata->pendingDeltaVersion + 1 < startState.changeFeedStartVersion &&
lastDeltaVersion + 1 >= startState.changeFeedStartVersion) {
oldChangeFeedDataComplete = startState.splitParentGranule.get();
}