adjut versions to handle KCV > recoveryVersion

This commit is contained in:
sramamoorthy 2019-06-27 15:44:44 -07:00 committed by Alex Miller
parent 62c14dae72
commit 33c2801944
1 changed files with 10 additions and 9 deletions

View File

@ -1302,6 +1302,10 @@ struct TagPartitionedLogSystem : ILogSystem, ReferenceCounted<TagPartitionedLogS
knownCommittedVersion = std::max(knownCommittedVersion, results[i].knownCommittedVersion);
}
if (knownCommittedVersion > results[new_safe_range_begin].end) {
knownCommittedVersion = results[new_safe_range_begin].end;
}
TraceEvent("GetDurableResult", dbgid).detail("Required", requiredCount).detail("Present", results.size()).detail("ServerState", sServerState)
.detail("RecoveryVersion", ((safe_range_end > 0) && (safe_range_end-1 < results.size())) ? results[ safe_range_end-1 ].end : -1)
.detail("EndVersion", results[ new_safe_range_begin ].end).detail("SafeBegin", safe_range_begin).detail("SafeEnd", safe_range_end)
@ -1588,17 +1592,14 @@ struct TagPartitionedLogSystem : ILogSystem, ReferenceCounted<TagPartitionedLogS
logSystem->logSystemType = prevState.logSystemType;
logSystem->rejoins = rejoins;
logSystem->lockResults = lockResults;
logSystem->recoverAt = minEnd;
if (knownCommittedVersion > minEnd) {
// FIXME: Remove the Sev40 once disk snapshot v2 feature is enabled, in all other
// code paths we should never be here.
TraceEvent(SevError, "KCVIsInvalid")
.detail("KnownCommittedVersion", knownCommittedVersion)
.detail("MinEnd", minEnd);
logSystem->knownCommittedVersion = minEnd;
} else {
logSystem->knownCommittedVersion = knownCommittedVersion;
knownCommittedVersion = minEnd;
}
logSystem->recoverAt = minEnd;
logSystem->knownCommittedVersion = knownCommittedVersion;
TraceEvent("RecoveryInfoFixed")
.detail("KCV", knownCommittedVersion)
.detail("MinEnd", minEnd);
logSystem->remoteLogsWrittenToCoreState = true;
logSystem->stopped = true;
logSystem->pseudoLocalities = prevState.pseudoLocalities;