fix: force recovery did not work if the latest log set did not recover th

This commit is contained in:
Evan Tschannen 2018-07-02 23:48:22 -04:00
parent 88ddc1c228
commit 57a8c6862e
1 changed files with 27 additions and 0 deletions

View File

@ -1174,6 +1174,33 @@ struct TagPartitionedLogSystem : ILogSystem, ReferenceCounted<TagPartitionedLogS
throw internal_error();
}
if(forceRecovery) {
DBCoreState modifiedState = prevState;
bool foundRemote = false;
for(auto& coreSet : modifiedState.tLogs) {
if(!coreSet.isLocal) {
foundRemote = true;
break;
}
}
while( !foundRemote && modifiedState.oldTLogData.size() ) {
for(auto& coreSet : modifiedState.oldTLogData[0].tLogs) {
if(!coreSet.isLocal) {
foundRemote = true;
break;
}
}
if(foundRemote) {
modifiedState.tLogs = modifiedState.oldTLogData[0].tLogs;
modifiedState.logRouterTags = modifiedState.oldTLogData[0].logRouterTags;
}
modifiedState.oldTLogData.erase(modifiedState.oldTLogData.begin());
}
if(foundRemote) {
prevState = modifiedState;
}
}
TEST( true ); // Master recovery from pre-existing database
// trackRejoins listens for rejoin requests from the tLogs that we are recovering from, to learn their TLogInterfaces