fix: do not let the storage server process an exhausted version, because it could prevent a rollback

This commit is contained in:
Evan Tschannen 2018-04-23 22:03:55 -07:00
parent ae1de575f1
commit 1cfe1cb7f0
2 changed files with 10 additions and 6 deletions

View File

@ -480,8 +480,7 @@ bool ILogSystem::MergedPeekCursor::isActive() {
}
bool ILogSystem::MergedPeekCursor::isExhausted() {
ASSERT(false);
return false;
return serverCursors[currentCursor]->isExhausted();
}
LogMessageVersion ILogSystem::MergedPeekCursor::version() { return messageVersion; }
@ -755,8 +754,7 @@ bool ILogSystem::SetPeekCursor::isActive() {
}
bool ILogSystem::SetPeekCursor::isExhausted() {
ASSERT(false);
return false;
return serverCursors[currentSet][currentCursor]->isExhausted();
}
LogMessageVersion ILogSystem::SetPeekCursor::version() { return messageVersion; }
@ -836,7 +834,7 @@ bool ILogSystem::MultiCursor::isActive() {
}
bool ILogSystem::MultiCursor::isExhausted() {
return cursors.back()->isActive();
return cursors.back()->isExhausted();
}
LogMessageVersion ILogSystem::MultiCursor::version() {

View File

@ -2351,7 +2351,13 @@ ACTOR Future<Void> update( StorageServer* data, bool* pReceivedUpdate )
state Reference<ILogSystem::IPeekCursor> cursor = data->logCursor;
//TraceEvent("SSUpdatePeeking", data->thisServerID).detail("MyVer", data->version.get()).detail("Epoch", data->updateEpoch).detail("Seq", data->updateSequence);
Void _ = wait( cursor->getMore() );
loop {
Void _ = wait( cursor->getMore() );
if(!cursor->isExhausted()) {
break;
}
}
if(cursor->popped() > 0)
throw worker_removed();