sanpwc commented on code in PR #5824: URL: https://github.com/apache/ignite-3/pull/5824#discussion_r2099772204
########## modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceRaftGroupEventsListener.java: ########## @@ -276,31 +265,53 @@ private void scheduleChangePeersAndLearners(PeersAndLearners peersAndLearners, l private void doStableKeySwitch( Set<Assignment> stableFromRaft, TablePartitionId tablePartitionId, - MetaStorageManager metaStorageMgr, long configurationTerm, long configurationIndex, BiFunction<TablePartitionId, Long, CompletableFuture<Set<Assignment>>> calculateAssignmentsFn ) { - try { - ByteArray pendingPartAssignmentsKey = pendingPartAssignmentsQueueKey(tablePartitionId); - ByteArray stablePartAssignmentsKey = stablePartAssignmentsKey(tablePartitionId); - ByteArray plannedPartAssignmentsKey = plannedPartAssignmentsKey(tablePartitionId); - ByteArray switchReduceKey = switchReduceKey(tablePartitionId); - ByteArray switchAppendKey = switchAppendKey(tablePartitionId); - ByteArray assignmentsChainKey = assignmentsChainKey(tablePartitionId); - - // TODO: https://issues.apache.org/jira/browse/IGNITE-17592 Remove synchronous wait - Map<ByteArray, Entry> values = metaStorageMgr.getAll( - Set.of( - plannedPartAssignmentsKey, - pendingPartAssignmentsKey, - stablePartAssignmentsKey, - switchReduceKey, - switchAppendKey, - assignmentsChainKey - ) - ).get(); + doStableKeySwitchImpl( + stableFromRaft, + tablePartitionId, + configurationTerm, + configurationIndex, + calculateAssignmentsFn + ).whenComplete((res, ex) -> { + // TODO: IGNITE-14693 + if (ex != null && !hasCause(ex, NodeStoppingException.class)) { + if (hasCause(ex, TimeoutException.class)) { Review Comment: I do understand that it's wasn't added in given PR, however that doesn't seem correct to me. How do you guarantee that rebalance logic will be able to make progress after ignoring TimeoutException? -- 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