tkalkirill commented on code in PR #2448:
URL: https://github.com/apache/ignite-3/pull/2448#discussion_r1294547622


##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/DistributionZoneRebalanceEngine.java:
##########
@@ -168,30 +138,34 @@ public CompletableFuture<Void> onUpdate(WatchEvent evt) {
 
                     int zoneId = 
extractZoneId(evt.entryEvent().newEntry().key());
 
-                    DistributionZoneView zoneConfig;
+                    // It is safe to get the latest version of the catalog as 
we are in the metastore thread.
+                    int catalogVersion = catalogService.latestCatalogVersion();
 
-                    try {
-                        zoneConfig = getZoneById(zonesConfiguration, 
zoneId).value();
-                    } catch (DistributionZoneNotFoundException e) {
-                        //The zone was removed.
-                        return completedFuture(null);
-                    }
+                    // TODO: IGNITE-20114 Should be get from the catalog 
directly
+                    // CatalogZoneDescriptor zoneDescriptor = 
catalogService.zone(zoneId, catalogVersion);
+
+                    String zoneName = 
distributionZoneManager.getZoneName(zoneId);
+
+                    assert zoneName != null : zoneId;
+
+                    CatalogZoneDescriptor zoneDescriptor = 
catalogService.zones(catalogVersion).stream()

Review Comment:
   This is a dirty temporary solution, later I think we will not need such a 
method (which you suggest), so I would not like to add it just like that.



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