From 9ee21a1ae5733d6b4c3e63037076ffccb9575d91 Mon Sep 17 00:00:00 2001 From: Young Liu Date: Sun, 28 Jun 2020 20:11:46 -0700 Subject: [PATCH] Fix getting read version while locked --- fdbserver/MasterProxyServer.actor.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fdbserver/MasterProxyServer.actor.cpp b/fdbserver/MasterProxyServer.actor.cpp index 4c79490b9b..c4d4caf741 100644 --- a/fdbserver/MasterProxyServer.actor.cpp +++ b/fdbserver/MasterProxyServer.actor.cpp @@ -1282,11 +1282,13 @@ ACTOR Future 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; } }