Skip to content

Commit

Permalink
Remove replicas on NOT_FOUND status exception (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
aprudhomme authored Oct 21, 2024
1 parent a83cf2f commit 287dd5f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/com/yelp/nrtsearch/server/nrt/NRTPrimaryNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,20 @@ void sendNewNRTPointToReplicas() {
Status status = e.getStatus();
if (status.getCode().equals(Status.UNAVAILABLE.getCode())) {
logger.warn(
"NRTPRimaryNode: sendNRTPoint, lost connection to replicaId: {} host: {} port: {}",
"NRTPrimaryNode: sendNRTPoint, lost connection to replicaId: {} host: {} port: {}",
replicaDetails.replicaId,
replicaDetails.replicationServerClient.getHost(),
replicaDetails.replicationServerClient.getPort());
currentReplicaServerClient.close();
it.remove();
} else if (status.getCode().equals(Status.FAILED_PRECONDITION.getCode())) {
} else if (status.getCode().equals(Status.FAILED_PRECONDITION.getCode())
|| status.getCode().equals(Status.NOT_FOUND.getCode())) {
logger.warn(
"NRTPRimaryNode: sendNRTPoint, replicaId: {} host: {} port: {} cannot process nrt point, closing connection",
"NRTPrimaryNode: sendNRTPoint, replicaId: {} host: {} port: {} cannot process nrt point, closing connection: {}",
replicaDetails.replicaId,
replicaDetails.replicationServerClient.getHost(),
replicaDetails.replicationServerClient.getPort());
replicaDetails.replicationServerClient.getPort(),
status);
currentReplicaServerClient.close();
it.remove();
}
Expand Down

0 comments on commit 287dd5f

Please sign in to comment.