Skip to content

Commit

Permalink
RepairRunner now consults the hostID field for the nominated segment …
Browse files Browse the repository at this point in the history
…and looks up its current IP when determining the list of potential coordinators.
  • Loading branch information
Miles-Garnsey committed Nov 8, 2022
1 parent 72a53d3 commit 92643af
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,21 @@ private void startNextSegment() throws ReaperException, InterruptedException {
for (RepairSegment segment : nextRepairSegments) {
Map<String, String> potentialReplicaMap = this.repairRunService.getDCsByNodeForRepairSegment(
cluster, segment.getTokenRange(), repairUnit.getKeyspaceName(), repairUnit);
potentialReplicas = repairUnit.getIncrementalRepair()
? Collections.singletonList(segment.getCoordinatorHost())
: potentialReplicaMap.keySet();
Map<String, String> endpointHostIDMap = clusterFacade.getEndpointToHostId(cluster);
String segmentHostID = segment.getHostID().toString();
if (repairUnit.getIncrementalRepair()) {
for (Entry<String, String> e : endpointHostIDMap.entrySet()) {
if (segmentHostID == e.getValue()) {
potentialReplicas = Collections.singletonList(e.getKey());
break;
}
}
} else {
potentialReplicas = potentialReplicaMap.keySet();
}
if (potentialReplicas.size() < 1) {
throw new ReaperException(String.format("No potential replicas found for host ID %s", segmentHostID));
}
JmxProxy coordinator = clusterFacade.connect(cluster, potentialReplicas);
if (nodesReadyForNewRepair(coordinator, segment, potentialReplicaMap, repairRunId)) {
nextRepairSegment = Optional.of(segment);
Expand Down

0 comments on commit 92643af

Please sign in to comment.