sanpwc commented on code in PR #6053:
URL: https://github.com/apache/ignite-3/pull/6053#discussion_r2541059121


##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java:
##########
@@ -788,7 +794,73 @@ public CompletableFuture<Replica> 
replica(ReplicationGroupId replicationGroupId)
      */
     public void resetPeers(ReplicationGroupId replicaGrpId, PeersAndLearners 
peersAndLearners, long sequenceToken) {
         RaftNodeId raftNodeId = new RaftNodeId(replicaGrpId, new 
Peer(localNodeConsistentId));
-        ((Loza) raftManager).resetPeers(raftNodeId, peersAndLearners, 
sequenceToken);
+        Loza loza = (Loza) raftManager;
+        Status status = loza.resetPeers(raftNodeId, peersAndLearners, 
sequenceToken);
+
+        // Stale configuration change will not be retried.
+        if (!status.isOk() && status.getRaftError() == RaftError.ESTALE) {
+            // TODO: proper error.

Review Comment:
   TODO without link.



##########
modules/partition-distribution/src/main/java/org/apache/ignite/internal/partitiondistribution/PartitionDistributionUtils.java:
##########
@@ -76,4 +79,19 @@ public static Set<Assignment> 
calculateAssignmentForPartition(
         return assignments.get(partitionId);
     }
 
+    /**
+     * Checks if an error is recoverable, so we can retry a rebalance intent.
+     *
+     * @param t The throwable.
+     * @return {@code True} if this is a recoverable exception.
+     */
+    public static boolean recoverable(Throwable t) {
+        if (hasCause(t, NodeStoppingException.class, 
ComponentStoppingException.class)) {
+            return false;
+        }
+        // As long as we don't have a general failure handler, we assume that 
all errors are recoverable.
+        String message = t.getMessage();
+        return message == null || !message.contains("ESTALE:Provided 
configuration is stale");

Review Comment:
   No way - it's fragile. If we need to detect whether it's a ESTALE we may 
introduce special internal exception class for that or any other robust 
approach that won't check exception message.
   
   BTW, the comment `// As long as we don't have a general failure handler, we 
assume that all errors are recoverable.` is no longer valid.



##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java:
##########
@@ -1442,6 +1430,23 @@ private CompletableFuture<Void> 
handleChangePendingAssignmentEvent(
                 }), ioExecutor);
     }
 
+    private static Assignments getComputedStableAssignments(@Nullable 
Assignments stableAssignments, Assignments pendingAssignments) {

Review Comment:
   Just a move, nothing 've changed, right?



##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java:
##########
@@ -1306,6 +1305,13 @@ private CompletableFuture<Void> 
handleChangePendingAssignmentEvent(Entry pending
                         zonePartitionId,
                         pendingAssignments.nodes(),
                         revision);
+            }).whenComplete((v, ex) -> {
+                if (ex != null) {

Review Comment:
   It's a tmp code that'll be reworked in 
https://issues.apache.org/jira/browse/IGNITE-23633, right?



-- 
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]

Reply via email to