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


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/StartedReplicationGroups.java:
##########
@@ -100,6 +102,23 @@ boolean hasReplicationGroupStarted(ZonePartitionId 
zonePartitionId) {
         return startedReplicationGroupIds.contains(zonePartitionId);
     }
 
+    /**
+     * Returns trueCompleted future if group was already started or awaits 
groups startup if it's in the middle of the start process,
+     * otherwise returns falseCompleted future.
+     */
+    CompletableFuture<Boolean> 
hasReplicationGroupStartedOrAwaitIfStarting(ZonePartitionId zonePartitionId) {
+        if (startedReplicationGroupIds.contains(zonePartitionId)) {
+            return trueCompletedFuture();
+        }
+
+        CompletableFuture<Void> groupStartingFuture = 
startingReplicationGroupIds.get(zonePartitionId);
+        if (groupStartingFuture != null) {

Review Comment:
   I though about it and didn't find legitimate case for the race. Since 
basically same approach is used within TableManager and we didn't so any 
problems for a long time - I hope there isn't.



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