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


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java:
##########
@@ -1295,15 +1330,14 @@ public void loadTableListenerToZoneReplica(
             Function<RaftCommandRunner, ReplicaListener> 
tablePartitionReplicaListenerFactory,
             RaftGroupListener tablePartitionRaftListener
     ) {
-        CompletableFuture<Replica> replicaFut = 
replicaMgr.replica(zonePartitionId);
-
-        assert replicaFut != null && replicaFut.isDone();
-
-        var zonePartitionReplicaListener = (ZonePartitionReplicaListener) 
replicaFut.join().listener();
+        Listeners listeners = listenersByZonePartitionId.get(zonePartitionId);
 
-        zonePartitionReplicaListener.addTableReplicaListener(tablePartitionId, 
tablePartitionReplicaListenerFactory);
+        listeners.replicaListenerFuture.thenAccept(zoneReplicaListener -> 
zoneReplicaListener.addTableReplicaListener(

Review Comment:
   Please add a comment explaining why deadlock is not possible neither during 
node startup nor during common zone + table creation. I mean that both table 
creation and thus loading table processor to zone and zone creation occur 
within MS watch thread.



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to