Merge pull request #4454 from vishesh/task/tlog-rf-old-tlog

status: Ignore LogSets with no tLogs when computing FT
This commit is contained in:
Evan Tschannen 2021-03-22 11:18:00 -07:00 committed by GitHub
commit bff7b9dcae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -2230,6 +2230,13 @@ static JsonBuilderObject tlogFetcher(int* logFaultTolerance,
int localSetsWithNonNegativeFaultTolerance = 0;
for (int i = 0; i < tLogs.size(); i++) {
if (tLogs[i].tLogs.size() == 0) {
// We can have LogSets where there are no tLogs but some LogRouters. It's the way
// recruiting is implemented for old LogRouters in TagPartitionedLogSystem, where
// it adds an empty LogSet for missing locality.
continue;
}
int failedLogs = 0;
for (auto& log : tLogs[i].tLogs) {
JsonBuilderObject logObj;
@ -2246,6 +2253,7 @@ static JsonBuilderObject tlogFetcher(int* logFaultTolerance,
}
if (tLogs[i].isLocal) {
ASSERT_WE_THINK(tLogs[i].tLogReplicationFactor > 0);
int currentFaultTolerance = tLogs[i].tLogReplicationFactor - 1 - tLogs[i].tLogWriteAntiQuorum - failedLogs;
if (currentFaultTolerance >= 0) {
localSetsWithNonNegativeFaultTolerance++;