JAkutenshi commented on code in PR #4545:
URL: https://github.com/apache/ignite-3/pull/4545#discussion_r1801081333
##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/ClusterManagementGroupManager.java:
##########
@@ -773,21 +774,21 @@ private CompletableFuture<CmgRaftService>
startCmgRaftService(Set<String> nodeNa
assert serverPeer != null;
try {
- return raftManager
- .startRaftGroupNodeAndWaitNodeReadyFuture(
- raftNodeId(serverPeer),
- raftConfiguration,
- new CmgRaftGroupListener(
- clusterStateStorageMgr,
- logicalTopology,
- validationManager,
- this::onLogicalTopologyChanged,
- clusterIdStore
- ),
- this::onElectedAsLeader,
- raftGroupOptionsConfigurer
- )
- .thenApply(service -> new CmgRaftService(service,
clusterService, logicalTopology));
+ RaftGroupService service =
raftManager.startRaftGroupNodeAndWaitNodeReady(
+ raftNodeId(serverPeer),
+ raftConfiguration,
+ new CmgRaftGroupListener(
+ clusterStateStorageMgr,
+ logicalTopology,
+ validationManager,
+ this::onLogicalTopologyChanged,
+ clusterIdStore
+ ),
+ this::onElectedAsLeader,
+ raftGroupOptionsConfigurer
+ );
+
+ return completedFuture(new CmgRaftService(service, clusterService,
logicalTopology));
Review Comment:
I remember this place, the reason why I left it is up to the stack there is
`startCmgRaftServiceWithEvents` that fires event and produce a future as the
result. And then all exception handling is doing in `whenComplete` stage after.
All that we will have if change the return on just `CmgRaftService` is rethrow
exception from the try. The current state looks more elegant, but it's
opinionated.
##########
modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/raft/service/ItAbstractListenerSnapshotTest.java:
##########
@@ -498,13 +498,11 @@ private RaftGroupService startClient(TestInfo testInfo,
TestReplicationGroupId g
Marshaller commandsMarshaller = commandsMarshaller(clientNode);
- CompletableFuture<RaftGroupService> clientFuture = RaftGroupServiceImpl
- .start(groupId, clientNode, FACTORY, raftConfiguration,
initialMemberConf, true, executor, commandsMarshaller);
+ RaftGroupService clientFuture = RaftGroupServiceImpl
Review Comment:
Done
--
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]