sanpwc commented on code in PR #6053: URL: https://github.com/apache/ignite-3/pull/6053#discussion_r2166016815
########## modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java: ########## @@ -790,9 +794,49 @@ public CompletableFuture<Replica> replica(ReplicationGroupId replicationGroupId) * @param replicaGrpId Replication group ID. * @param peersAndLearners New node configuration. */ - public void resetPeers(ReplicationGroupId replicaGrpId, PeersAndLearners peersAndLearners) { + public boolean resetPeers(ReplicationGroupId replicaGrpId, PeersAndLearners peersAndLearners) { RaftNodeId raftNodeId = new RaftNodeId(replicaGrpId, new Peer(localNodeConsistentId)); - ((Loza) raftManager).resetPeers(raftNodeId, peersAndLearners); + return ((Loza) raftManager).resetPeers(raftNodeId, peersAndLearners); + } + + /** + * Performs a {@code resetPeers} operation on raft node with retries. + * + * @param replicaGrpId Replication group ID. + * @param assignments New assignments. + */ + public CompletableFuture<Void> resetWithRetry(ReplicationGroupId replicaGrpId, Assignments assignments) { + return supplyAsync(() -> inBusyLock(busyLock, () -> { Review Comment: How do you guarantee proper ordering of resettingPeers? I mean following situation: 1. pendingAssignments = [A] force -> reset is called in a async manner, thread hangs. 2. pendingAssignments = [B] force // e.g. from manual reset -> reset called in an async manner, applied 3. reset([A]) unhangs -> and overrides proper [B]. -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org