alievmirza commented on code in PR #1631:
URL: https://github.com/apache/ignite-3/pull/1631#discussion_r1100180710


##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/DistributionZoneManager.java:
##########
@@ -557,24 +561,57 @@ public CompletableFuture<?> 
onUpdate(ConfigurationNotificationEvent<Distribution
 
             int oldScaleUp;
 
+            int oldScaleDown;
+
             // ctx.oldValue() could be null for the default zone on a first 
start.
             if (ctx.oldValue() == null) {
                 oldScaleUp = Integer.MAX_VALUE;
+
+                oldScaleDown = Integer.MAX_VALUE;
             } else {
                 oldScaleUp = ctx.oldValue().dataNodesAutoAdjustScaleUp();
+
+                oldScaleDown = ctx.oldValue().dataNodesAutoAdjustScaleDown();
             }
 
             int newScaleUp = ctx.newValue().dataNodesAutoAdjustScaleUp();
 
-            if (newScaleUp != Integer.MAX_VALUE && oldScaleUp != newScaleUp) {
-                // It is safe to zonesTimers.get(zoneId) in term of NPE 
because meta storage notifications are one-threaded
-                zonesState.get(zoneId).rescheduleScaleUp(
-                        newScaleUp,
-                        () -> CompletableFuture.supplyAsync(
-                                () -> 
saveDataNodesToMetaStorageOnScaleUp(zoneId, ctx.storageRevision()),
-                                Runnable::run
-                        )
-                );
+            int newScaleDown = ctx.newValue().dataNodesAutoAdjustScaleDown();
+
+            // It is safe to zonesTimers.get(zoneId) in term of NPE because 
meta storage notifications are one-threaded
+            // and this map will me initialized on a manager start or with 
onCreate configuration notification

Review Comment:
   fixed



##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/DistributionZoneManager.java:
##########
@@ -925,14 +963,15 @@ private void scheduleTimers(
      * @param addedNodes Nodes that was added to a topology and should be 
added to zones data nodes.
      * @param removedNodes Nodes that was removed from a topology and should 
be removed from zones data nodes.
      * @param revision Revision that triggered that event.
-     * @param saveDataNodes Function that save nodes to a zone's data nodes.
+     * @param saveDataNodesOnScaleUp Function that save nodes to a zone's data 
nodes.

Review Comment:
   fized



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