rpuch commented on code in PR #5824:
URL: https://github.com/apache/ignite-3/pull/5824#discussion_r2099948607


##########
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)) {
+                    // TODO: 
https://issues.apache.org/jira/browse/IGNITE-25276 - handle this timeout 
properly.
+                    LOG.error("Unable to commit partition configuration to 
metastore: {}", ex, tablePartitionId);
+                } else {
+                    String errorMessage = String.format("Unable to commit 
partition configuration to metastore: %s", tablePartitionId);
+                    failureProcessor.process(new FailureContext(ex, 
errorMessage));
+                }
+            }
+        });
+    }
 
+    private CompletableFuture<Void> doStableKeySwitchImpl(
+            Set<Assignment> stableFromRaft,
+            TablePartitionId tablePartitionId,
+            long configurationTerm,
+            long configurationIndex,
+            BiFunction<TablePartitionId, Long, 
CompletableFuture<Set<Assignment>>> calculateAssignmentsFn
+    ) {
+        ByteArray pendingPartAssignmentsKey = 
pendingPartAssignmentsQueueKey(tablePartitionId);

Review Comment:
   Only technical stuff (like introducing a final variable) to make the code 
compile and pass checkstyle



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