Merge pull request #3428 from yliucode/fix-lock-grv

Fix getting read version while locked
This commit is contained in:
Jingyu Zhou 2020-06-30 11:14:44 -07:00 committed by GitHub
commit 20658f0326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -1282,11 +1282,13 @@ ACTOR Future<Void> commitBatch(
// Let master know this commit version so that every other proxy can know.
wait(self->master.reportLiveCommittedVersion.getReply(ReportRawCommittedVersionRequest(commitVersion, lockedAfter, metadataVersionAfter), TaskPriority::ProxyMasterVersionReply));
}
self->locked = lockedAfter;
self->metadataVersion = metadataVersionAfter;
TEST(commitVersion < self->committedVersion.get());
// After we report the commit version above, other batch commitBatch executions may have updated 'self->committedVersion'
// to be a larger commitVersion.
if (commitVersion > self->committedVersion.get()) {
self->committedVersion.set(commitVersion);
self->locked = lockedAfter;
self->metadataVersion = metadataVersionAfter;
}
}