diff --git a/fdbserver/LogSystem.h b/fdbserver/LogSystem.h index 1db54c801e..5b66b9845b 100644 --- a/fdbserver/LogSystem.h +++ b/fdbserver/LogSystem.h @@ -581,6 +581,7 @@ struct ILogSystem { Version poppedVersion; Version initialPoppedVersion; bool canDiscardPopped; + Future more; //FIXME: collectTags is needed to support upgrades from 5.X to 6.0. Remove this code when we no longer support that upgrade. bool collectTags; diff --git a/fdbserver/LogSystemPeekCursor.actor.cpp b/fdbserver/LogSystemPeekCursor.actor.cpp index 0ccf397de6..1584c17a07 100644 --- a/fdbserver/LogSystemPeekCursor.actor.cpp +++ b/fdbserver/LogSystemPeekCursor.actor.cpp @@ -1038,6 +1038,9 @@ ACTOR Future bufferedGetMore( ILogSystem::BufferedCursor* self, TaskPriori if(self->canDiscardPopped && self->poppedVersion > self->version().version) { TraceEvent(SevWarn, "DiscardingPoppedData").detail("Version", self->version().version).detail("Popped", self->poppedVersion); self->messageVersion = std::max(self->messageVersion, LogMessageVersion(self->poppedVersion)); + for(auto& cursor : self->cursors) { + cursor->advanceTo(self->messageVersion); + } self->messageIndex = self->messages.size(); if (self->messages.size() > 0 && self->messages[self->messages.size()-1].version < self->messageVersion) { self->hasNextMessage = false; @@ -1057,9 +1060,14 @@ ACTOR Future bufferedGetMore( ILogSystem::BufferedCursor* self, TaskPriori } Future ILogSystem::BufferedCursor::getMore(TaskPriority taskID) { - if( hasMessage() ) + if( hasMessage() ) { return Void(); - return bufferedGetMore(this, taskID); + } + + if( !more.isValid() || more.isReady() ) { + more = bufferedGetMore(this, taskID); + } + return more; } Future ILogSystem::BufferedCursor::onFailed() {