bdeggleston commented on code in PR #3174:
URL: https://github.com/apache/cassandra/pull/3174#discussion_r1548724816
##########
src/java/org/apache/cassandra/service/consensus/migration/ConsensusMigrationRepairResult.java:
##########
@@ -33,18 +34,30 @@ private
ConsensusMigrationRepairResult(ConsensusMigrationRepairType type, Epoch
this.minEpoch = minEpoch;
}
- public static ConsensusMigrationRepairResult fromCassandraRepair(Epoch
minEpoch, boolean migrationEligibleRepair)
+ public static ConsensusMigrationRepairResult fromRepair(Epoch minEpoch,
boolean paxosRepaired, boolean accordRepaired, boolean deadNodesExcluded)
{
- checkArgument(!migrationEligibleRepair ||
minEpoch.isAfter(Epoch.EMPTY), "Epoch should not be empty if Paxos and regular
repairs were performed");
- if (migrationEligibleRepair)
- return new
ConsensusMigrationRepairResult(ConsensusMigrationRepairType.paxos, minEpoch);
- else
- return new
ConsensusMigrationRepairResult(ConsensusMigrationRepairType.ineligible,
Epoch.EMPTY);
+ checkArgument((!paxosRepaired && !accordRepaired) ||
minEpoch.isAfter(Epoch.EMPTY), "Epoch should not be empty if Paxos and regular
repairs were performed");
+
+ if (deadNodesExcluded) return INELIGIBLE;
+ if (paxosRepaired && accordRepaired) return new
ConsensusMigrationRepairResult(ConsensusMigrationRepairType.either, minEpoch);
+ if (paxosRepaired) return new
ConsensusMigrationRepairResult(ConsensusMigrationRepairType.paxos, minEpoch);
+ if (accordRepaired) return new
ConsensusMigrationRepairResult(ConsensusMigrationRepairType.accord, minEpoch);
+ return INELIGIBLE;
+ }
+
+ public static ConsensusMigrationRepairResult fromPaxosOnlyRepair(Epoch
minEpoch, boolean deadNodesExcluded)
+ {
+ return fromRepair(minEpoch, true, false, deadNodesExcluded);
Review Comment:
good catch, thanks. Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]