sergeyuttsel commented on code in PR #1426:
URL: https://github.com/apache/ignite-3/pull/1426#discussion_r1049890192
##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/DistributionZoneManager.java:
##########
@@ -235,6 +257,98 @@ public CompletableFuture<Void> dropZone(String name) {
@Override
public void start() {
zonesConfiguration.distributionZones().listenElements(new
ZonesConfigurationListener());
+
+ long vaultAppliedRevision = vaultAppliedRevision();
+
+ VaultEntry vaultEntry;
+
+ try {
+ vaultEntry = vaultMgr.get(zonesLogicalTopologyKey()).get();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new IgniteInternalException(e);
+ }
+
+ if (vaultEntry != null && vaultEntry.value() != null) {
+ byte[] newLogicalTopology = vaultEntry.value();
+
+ logicalTopology = ByteUtils.fromBytes(newLogicalTopology);
+
+ zonesConfiguration.distributionZones().value().namedListKeys()
+ .forEach(zoneName -> {
+ int zoneId =
zonesConfiguration.distributionZones().get(zoneName).zoneId().value();
+
+ saveDataNodesToMetastorage(zoneId, newLogicalTopology,
vaultAppliedRevision);
+ });
+ }
+
+ metaStorageManager.registerWatch(zonesLogicalTopologyKey(), new
WatchListener() {
Review Comment:
Sounds right
--
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]