vldpyatkov commented on a change in pull request #399:
URL: https://github.com/apache/ignite-3/pull/399#discussion_r733178958
##########
File path: modules/raft/src/main/java/org/apache/ignite/internal/raft/Loza.java
##########
@@ -120,32 +126,35 @@ public Loza(ClusterService clusterNetSvc, Path dataPath) {
* @param groupId Raft group id.
* @param nodes Raft group nodes.
* @param lsnrSupplier Raft group listener supplier.
- * @param clientTimeout Client retry timeout.
- * @param networkTimeout Client network timeout.
* @return Future representing pending completion of the operation.
*/
@Experimental
public CompletableFuture<RaftGroupService> prepareRaftGroup(
String groupId,
List<ClusterNode> nodes,
- Supplier<RaftGroupListener> lsnrSupplier,
- int clientTimeout,
- int networkTimeout) {
+ Supplier<RaftGroupListener> lsnrSupplier
+ ) {
assert !nodes.isEmpty();
List<Peer> peers = nodes.stream().map(n -> new
Peer(n.address())).collect(Collectors.toList());
String locNodeName =
clusterNetSvc.topologyService().localMember().name();
- if (nodes.stream().anyMatch(n -> locNodeName.equals(n.name())))
- raftServer.startRaftGroup(groupId, lsnrSupplier.get(), peers);
+ boolean hasLocalRaft = nodes.stream().anyMatch(n ->
locNodeName.equals(n.name()));
+
+ if (hasLocalRaft && !localGroups.contains(groupId)) {
+ if (raftServer.startRaftGroup(groupId, lsnrSupplier.get(), peers))
+ localGroups.add(groupId);
+ else
+ LOG.error("Failed to start raft group on the node [node={},
raftGrp={}]", locNodeName, groupId);
Review comment:
Unfortunately, 'false' would typical result here on a changing
assignment (after localGroups was removed).
We can get reassignment to the similar cluster node where a RAFT node
already exists.
I changed the message to info level and change the Javadoc by your advice.
--
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]