ibessonov commented on code in PR #937:
URL: https://github.com/apache/ignite-3/pull/937#discussion_r926468659


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -485,24 +486,38 @@ private void 
updateAssignmentInternal(ConfigurationNotificationEvent<byte[]> ass
                     assert internalTbl.storage() instanceof MvTableStorage :
                             "Only multi version storages are supported. 
Current storage is a " + internalTbl.storage().getClass().getName();
 
-                    futures[partId] = raftMgr.updateRaftGroup(
-                            partitionRaftGroupName(tblId, partId),
-                            newPartAssignment,
-                            // start new nodes, only if it is table creation
-                            // other cases will be covered by rebalance logic
-                            (oldPartAssignment.isEmpty()) ? newPartAssignment 
: Collections.emptyList(),
-                            () -> new PartitionListener(tblId,
-                                    new VersionedRowStore(((MvTableStorage) 
internalTbl.storage()).getOrCreateMvPartition(partId),
-                                            txManager)),
-                            () -> new RebalanceRaftGroupEventsListener(
-                                    metaStorageMgr,
-                                    
tablesCfg.tables().get(tablesById.get(tblId).name()),
-                                    partitionRaftGroupName(tblId, partId),
-                                    partId,
-                                    busyLock,
-                                    movePartition(() -> 
internalTbl.partitionRaftGroupService(partId)),
-                                    rebalanceScheduler),
-                            groupOptionsForInternalTable(internalTbl)
+                    // start new nodes, only if it is table creation
+                    // other cases will be covered by rebalance logic
+                    List<ClusterNode> nodes = (oldPartAssignment.isEmpty()) ? 
newPartAssignment : Collections.emptyList();
+
+                    String grpId = partitionRaftGroupName(tblId, partId);
+
+                    if (raftMgr.shouldHaveRaftGroupLocally(nodes)) {
+                        MvPartitionStorage partitionStorage = 
internalTbl.storage().getOrCreateMvPartition(partId);
+
+                        RaftGroupOptions groupOptions = 
groupOptionsForPartition(internalTbl, partitionStorage, newPartAssignment);
+
+                        raftMgr.startRaftGroupNode(
+                                grpId,
+                                newPartAssignment,
+                                new PartitionListener(tblId,
+                                        new VersionedRowStore(partitionStorage,
+                                                txManager)),
+                                new RebalanceRaftGroupEventsListener(
+                                        metaStorageMgr,
+                                        
tablesCfg.tables().get(tablesById.get(tblId).name()),
+                                        grpId,
+                                        partId,
+                                        busyLock,
+                                        movePartition(() -> 
internalTbl.partitionRaftGroupService(partId)),
+                                        rebalanceScheduler),
+                                groupOptions

Review Comment:
   This suggestion isn't aligned properly



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