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


##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/DistributionZoneManager.java:
##########
@@ -375,6 +379,42 @@ private CompletableFuture<Void> 
onUpdateScaleUpBusy(AlterZoneEventParameters par
         return nullCompletedFuture();
     }
 
+    private CompletableFuture<Void> onUpdatePartitionDistributionResetBusy(int 
partitionDistributionReset, long causalityToken) {
+        // It is safe to zoneState.entrySet in term of ConcurrentModification 
and etc. because meta storage notifications are one-threaded
+        // and this map will be initialized on a manager start or with catalog 
notification or with distribution configuration changes.
+        for (Map.Entry<Integer, ZoneState> zoneStateEntry : 
zonesState.entrySet()) {
+            int zoneId = zoneStateEntry.getKey();

Review Comment:
   I'd rather use zoneDescriptor as is. First of all ZoneState isn't a proper 
place for zone attributes like consistencyMode. Besides that consistencyMode 
might be mutable. BTW is it mutable now? All in all using catalog is simple 
enough:
   ```
           for (Map.Entry<Integer, ZoneState> zoneStateEntry : 
zonesState.entrySet()) {
               int zoneId = zoneStateEntry.getKey();
   
               CatalogZoneDescriptor zoneDescriptor =
                       catalogManager.zone(zoneId, 
metaStorageManager.timestampByRevisionLocally(causalityToken).longValue());
   
               if (zoneDescriptor.consistencyMode() != HIGH_AVAILABILITY) {
                   continue;
               }
   ```



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