denis-chudov commented on code in PR #2036:
URL: https://github.com/apache/ignite-3/pull/2036#discussion_r1189707483
##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java:
##########
@@ -170,17 +189,29 @@ private void onReplicaMessageReceived(NetworkMessage
message, String senderConsi
}
// replicaFut is always completed here.
- CompletableFuture<?> result =
replicaFut.join().processRequest(request);
+ Replica replica = replicaFut.join();
+
+ CompletableFuture<?> result = replica.processRequest(request);
result.handle((res, ex) -> {
NetworkMessage msg;
if (ex == null) {
msg = prepareReplicaResponse(requestTimestamp, res);
+
+ ClusterNode localNode =
clusterNetSvc.topologyService().localMember();
+
+ if (request instanceof PrimaryReplicaRequest &&
!localNode.name().equals(replica.proposedPrimary())) {
+ declineLeaseProlongation(request.groupId(),
replica.proposedPrimary());
+ }
} else {
LOG.warn("Failed to process replica request [request={}]",
ex, request);
msg = prepareReplicaErrorResponse(requestTimestamp, ex);
+
+ if (request instanceof PrimaryReplicaRequest &&
isTimeoutException(ex)) {
+ declineLeaseProlongation(request.groupId(), null);
+ }
Review Comment:
https://issues.apache.org/jira/browse/IGNITE-19441
--
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]