rpuch commented on code in PR #5612:
URL: https://github.com/apache/ignite-3/pull/5612#discussion_r2039758323


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java:
##########
@@ -535,8 +534,11 @@ private CompletableFuture<Void> createZoneReplicationNodes(
             int catalogVersion,
             int partitionCount
     ) {
-        return inBusyLockAsync(busyLock, () -> {
-            assert assignments != null : IgniteStringFormatter.format("Zone 
has empty assignments [id={}].", zoneId);
+        // Zone nodes might be created in the same catalog version as a table 
in this zone, so there could be a race
+        // between storage creation due to replica start and storage creation 
due to table addition. To eliminate the race,
+        // we acquire a write lock on the zone (table addition acquires a read 
lock).
+        return inBusyLockAsync(busyLock, () -> 
executeUnderZoneWriteLock(zoneId, () -> inBusyLockAsync(busyLock, () -> {
+        assert assignments != null : IgniteStringFormatter.format("Zone has 
empty assignments [id={}].", zoneId);

Review Comment:
   Tried to fix it



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