fix: log router version needs to be fetched before it is available

fix: tlog did not fetch known committed version if start version was exactly equal to it
This commit is contained in:
Evan Tschannen 2018-04-17 11:16:48 -07:00
parent 093908b83f
commit 760bc8bc99
2 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,7 @@ struct LogRouterData {
return newTagData;
}
LogRouterData(UID dbgid, Tag routerTag, int logSet, Version startVersion) : dbgid(dbgid), routerTag(routerTag), logSet(logSet), logSystem(new AsyncVar<Reference<ILogSystem>>()), version(startVersion), minPopped(startVersion-1), startVersion(startVersion) {}
LogRouterData(UID dbgid, Tag routerTag, int logSet, Version startVersion) : dbgid(dbgid), routerTag(routerTag), logSet(logSet), logSystem(new AsyncVar<Reference<ILogSystem>>()), version(startVersion-1), minPopped(startVersion-1), startVersion(startVersion) {}
};
void commitMessages( LogRouterData* self, Version version, const std::vector<TagsAndMessage>& taggedMessages ) {
@ -154,7 +154,7 @@ void commitMessages( LogRouterData* self, Version version, const std::vector<Tag
ACTOR Future<Void> pullAsyncData( LogRouterData *self, Tag tag ) {
state Future<Void> dbInfoChange = Void();
state Reference<ILogSystem::IPeekCursor> r;
state Version tagAt = self->version.get();
state Version tagAt = self->version.get() + 1;
state Version tagPopped = 0;
state Version lastVer = 0;
state std::vector<int> tags;

View File

@ -1884,7 +1884,7 @@ ACTOR Future<Void> tLogStart( TLogData* self, InitializeTLogRequest req, Localit
logData->initialized = true;
self->newLogData.trigger();
if(req.isPrimary && logData->unrecoveredBefore < req.knownCommittedVersion && !logData->stopped) {
if(req.isPrimary && logData->unrecoveredBefore <= req.knownCommittedVersion && !logData->stopped) {
logData->logRouterPopToVersion = req.knownCommittedVersion;
std::vector<Tag> tags;
tags.push_back(logData->remoteTag);