From 1003057a7e5f3181b43adc1c81e05f6ec905fa9c Mon Sep 17 00:00:00 2001 From: sfc-gh-tclinkenbeard Date: Thu, 3 Dec 2020 09:36:44 -0800 Subject: [PATCH] Removed TLogData::toBePoppedMutex --- fdbserver/TLogServer.actor.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/fdbserver/TLogServer.actor.cpp b/fdbserver/TLogServer.actor.cpp index 485942cf49..fadfe14867 100644 --- a/fdbserver/TLogServer.actor.cpp +++ b/fdbserver/TLogServer.actor.cpp @@ -340,7 +340,6 @@ struct TLogData : NonCopyable { // the set and for callers that unset will // be able to match it up std::string dataFolder; // folder where data is stored - FlowLock toBePoppedMutex; std::map toBePopped; // map of Tag->Version for all the pops // that came when ignorePopRequest was set Reference> degraded; @@ -1006,19 +1005,12 @@ ACTOR Future updatePersistentData( TLogData* self, Reference logD return Void(); } -ACTOR Future queuePopRequest(TLogData* self, Tag tag, Version version) { - wait(self->toBePoppedMutex.take()); - FlowLock::Releaser releaser(self->toBePoppedMutex); - auto& v = self->toBePopped[tag]; - v = std::max(v, version); - return Void(); -} - ACTOR Future tLogPopCore( TLogData* self, Tag inputTag, Version to, Reference logData ) { if (self->ignorePopRequest) { TraceEvent(SevDebug, "IgnoringPopRequest").detail("IgnorePopDeadline", self->ignorePopDeadline); - wait(queuePopRequest(self, inputTag, to)); + auto& v = self->toBePopped[inputTag]; + v = std::max(v, to); TraceEvent(SevDebug, "IgnoringPopRequest") .detail("IgnorePopDeadline", self->ignorePopDeadline) @@ -1063,15 +1055,16 @@ ACTOR Future tLogPopCore( TLogData* self, Tag inputTag, Version to, Refere ACTOR Future processPopRequests(TLogData* self, Reference logData) { state const size_t batchSize = 1000; - wait(self->toBePoppedMutex.take()); - FlowLock::Releaser releaser(self->toBePoppedMutex); state std::vector> ignoredPops; state std::map::const_iterator it; state int ignoredPopsPlayed = 0; + state std::map toBePopped; + toBePopped = std::move(self->toBePopped); + self->toBePopped.clear(); self->ignorePopRequest = false; self->ignorePopDeadline = 0.0; self->ignorePopUid = ""; - for (it = self->toBePopped.cbegin(); it != self->toBePopped.cend(); ++it) { + for (it = toBePopped.cbegin(); it != toBePopped.cend(); ++it) { const auto& [tag, version] = *it; TraceEvent("PlayIgnoredPop").detail("Tag", tag.toString()).detail("Version", version); ignoredPops.push_back(tLogPopCore(self, tag, version, logData)); @@ -1079,7 +1072,6 @@ ACTOR Future processPopRequests(TLogData* self, Reference logData wait(yield()); } } - self->toBePopped.clear(); wait(waitForAll(ignoredPops)); return Void(); }