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


##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/DistributionZoneManager.java:
##########
@@ -1945,29 +1365,84 @@ public Set<NodeWithAttributes> logicalTopology() {
         return logicalTopology;
     }
 
-    /**
-     * Returns the distribution zone name from the configuration, {@code null} 
if the zone is absent.
-     *
-     * @param configZoneId Distribution zone id from configuration.
-     */
-    // TODO: IGNITE-20114 Get rid of
-    @Deprecated(forRemoval = true)
-    public @Nullable String getZoneName(int configZoneId) {
-        DistributionZonesView zonesView = zonesConfiguration.value();
-
-        return Stream.concat(Stream.of(zonesView.defaultDistributionZone()), 
zonesView.distributionZones().stream())
-                .filter(zoneView -> zoneView.zoneId() == configZoneId)
-                .map(DistributionZoneView::name)
-                .findFirst()
-                .orElse(null);
+    private void registerCatalogEventListenersOnStartManagerBusy() {
+        catalogManager.listen(ZONE_CREATE, (parameters, exception) -> 
inBusyLock(busyLock, () -> {
+            assert exception == null : parameters;
+
+            CreateZoneEventParameters params = (CreateZoneEventParameters) 
parameters;
+
+            createOrRestoreZoneStateBusy(params.zoneDescriptor(), 
params.causalityToken());
+
+            return completedFuture(false);
+        }));
+
+        catalogManager.listen(ZONE_DROP, (parameters, exception) -> 
inBusyLock(busyLock, () -> {
+            assert exception == null : parameters;
+
+            onDropZoneBusy((DropZoneEventParameters) parameters);
+
+            return completedFuture(false);
+        }));
+
+        catalogManager.listen(ZONE_ALTER, new 
ManagerCatalogAlterZoneEventListener());
+    }
+
+    private void startZonesOnStartManagerBusy() {
+        CompletableFuture<Long> recoveryFinishedFuture = 
metaStorageManager.recoveryFinishedFuture();
+
+        assert recoveryFinishedFuture.isDone();
+
+        int catalogVersion = catalogManager.latestCatalogVersion();
+        long causalityToken = recoveryFinishedFuture.join();
+
+        for (CatalogZoneDescriptor zone : 
catalogManager.zones(catalogVersion)) {

Review Comment:
   We should also cleanup all abandoned resources. Both local (vault) and 
distributed (ms based keys). I would rather create two separate tickets for 
both that items in order not to clutter up given PR, however they should be 
ranked as important ones.



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