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


##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageManagerImpl.java:
##########
@@ -462,28 +464,30 @@ private CompletableFuture<? extends RaftGroupService> 
startRaftNode(
                 }
         );
 
-        serviceFuture
-                .thenAccept(service -> service.subscribeLeader(new 
MetaStorageLeaderElectionListener(
-                        busyLock,
-                        clusterService,
-                        logicalTopologyService,
-                        metaStorageSvcFut,
-                        learnerManager,
-                        clusterTime,
-                        // We use the "deployWatchesFuture" to guarantee that 
the Configuration Manager will be started
-                        // when the underlying code tries to read Meta Storage 
configuration. This is a consequence of having a circular
-                        // dependency between these two components.
-                        deployWatchesFuture.thenApply(v -> 
localMetaStorageConfiguration),
-                        electionListeners,
-                        this::peersChangeStateExists
-                )))
-                .whenComplete((v, e) -> {
+        LeaderElectionListener leaderElectionListener = new 
MetaStorageLeaderElectionListener(
+                busyLock,
+                clusterService,
+                logicalTopologyService,
+                metaStorageSvcFut,
+                learnerManager,
+                clusterTime,
+                // We use the "deployWatchesFuture" to guarantee that the 
Configuration Manager will be started
+                // when the underlying code tries to read Meta Storage 
configuration. This is a consequence of having a circular
+                // dependency between these two components.
+                deployWatchesFuture.thenApply(v -> 
localMetaStorageConfiguration),
+                electionListeners,
+                this::peersChangeStateExists
+        );
+
+        return completedFuture(service)

Review Comment:
   Ok, let's move it to followup - let's discuss that.



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