Skip to content

Commit

Permalink
Remove endpoints from schema pulls if other node is down (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
andybradshaw committed Dec 7, 2024
1 parent 6aad1ab commit 627a5dc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/java/org/apache/cassandra/service/MigrationTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void runMayThrow() throws Exception
if (!FailureDetector.instance.isAlive(endpoint))
{
logger.warn("Can't send schema pull request: node {} is down.", endpoint);
version.ifPresent(v -> MigrationManager.removeEndpointFromSchemaPullVersion(v, endpoint));
return;
}

Expand All @@ -72,6 +73,7 @@ public void runMayThrow() throws Exception
if (!MigrationManager.shouldPullSchemaFrom(endpoint))
{
logger.info("Skipped sending a migration request: node {} has a higher major version now.", endpoint);
version.ifPresent(v -> MigrationManager.removeEndpointFromSchemaPullVersion(v, endpoint));
return;
}

Expand Down Expand Up @@ -124,6 +126,12 @@ public boolean isLatencyForSnitch()
return false;
}
};
MessagingService.instance().sendRRWithFailure(message, endpoint, cb);
try {
MessagingService.instance().sendRRWithFailure(message, endpoint, cb);
}
catch (Exception e)
{
version.ifPresent(v -> MigrationManager.removeEndpointFromSchemaPullVersion(v, endpoint));
}
}
}

0 comments on commit 627a5dc

Please sign in to comment.