fixed naming and comments

This commit is contained in:
Evan Tschannen 2020-09-30 20:35:09 -07:00
parent d350f6310b
commit b1180f8eb4
1 changed files with 3 additions and 4 deletions

View File

@ -1920,7 +1920,7 @@ static JsonBuilderObject tlogFetcher(int* logFaultTolerance, const std::vector<T
remote_log_fault_tolerance; remote_log_fault_tolerance;
int minFaultTolerance = 1000; int minFaultTolerance = 1000;
int localSetsWithPositiveFaultTolerance = 0; int localSetsWithNonNegativeFaultTolerance = 0;
for (int i = 0; i < tLogs.size(); i++) { for (int i = 0; i < tLogs.size(); i++) {
int failedLogs = 0; int failedLogs = 0;
@ -1939,10 +1939,9 @@ static JsonBuilderObject tlogFetcher(int* logFaultTolerance, const std::vector<T
} }
if (tLogs[i].isLocal) { if (tLogs[i].isLocal) {
// The log generation's fault tolerance is the maximum tlog fault tolerance of each region.
int currentFaultTolerance = tLogs[i].tLogReplicationFactor - 1 - tLogs[i].tLogWriteAntiQuorum - failedLogs; int currentFaultTolerance = tLogs[i].tLogReplicationFactor - 1 - tLogs[i].tLogWriteAntiQuorum - failedLogs;
if(currentFaultTolerance >= 0) { if(currentFaultTolerance >= 0) {
localSetsWithPositiveFaultTolerance++; localSetsWithNonNegativeFaultTolerance++;
} }
minFaultTolerance = std::min(minFaultTolerance, currentFaultTolerance); minFaultTolerance = std::min(minFaultTolerance, currentFaultTolerance);
} }
@ -1964,7 +1963,7 @@ static JsonBuilderObject tlogFetcher(int* logFaultTolerance, const std::vector<T
//just in case we do not have any tlog sets //just in case we do not have any tlog sets
minFaultTolerance = 0; minFaultTolerance = 0;
} }
if(localSetsWithPositiveFaultTolerance > 1) { if(localSetsWithNonNegativeFaultTolerance > 1) {
minFaultTolerance++; minFaultTolerance++;
} }
*logFaultTolerance = std::min(*logFaultTolerance, minFaultTolerance); *logFaultTolerance = std::min(*logFaultTolerance, minFaultTolerance);