jtuglu1 commented on code in PR #19269:
URL: https://github.com/apache/druid/pull/19269#discussion_r3081619767


##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:
##########
@@ -174,11 +174,26 @@ public int computeTaskCountForScaleAction()
     lastKnownMetrics = collectMetrics();
 
     final int optimalTaskCount = computeOptimalTaskCount(lastKnownMetrics);
-    final int currentTaskCount = supervisor.getIoConfig().getTaskCount();
+    int currentTaskCount = supervisor.getIoConfig().getTaskCount();
+
+    // Take the current task count but clamp it to the configured boundaries 
if it is outside the boundaries.
+    // There might be a configuration instance with a handwritten taskCount 
that is outside the boundaries.
+    final boolean isTaskCountOutOfBounds = currentTaskCount < 
config.getTaskCountMin()

Review Comment:
   > Ah, fair, but why I did it: we're emitting min/max with scalingSkipReason 
dimension ... so it explicitly means 'no scaling was performed'.
   
   Yes but the metric is a different meaning here. IMO, we should not be 
emitting a metric if we explicitly don't want to scale/don't want to make a 
decision on scaling. The metric being emitted means we wanted to scale up/down 
to some value that's outside the bounds of our spec. The value `-1` implies 
something else.



##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:
##########
@@ -174,11 +174,26 @@ public int computeTaskCountForScaleAction()
     lastKnownMetrics = collectMetrics();
 
     final int optimalTaskCount = computeOptimalTaskCount(lastKnownMetrics);
-    final int currentTaskCount = supervisor.getIoConfig().getTaskCount();
+    int currentTaskCount = supervisor.getIoConfig().getTaskCount();
+
+    // Take the current task count but clamp it to the configured boundaries 
if it is outside the boundaries.
+    // There might be a configuration instance with a handwritten taskCount 
that is outside the boundaries.
+    final boolean isTaskCountOutOfBounds = currentTaskCount < 
config.getTaskCountMin()

Review Comment:
   > Ah, fair, but why I did it: we're emitting min/max with scalingSkipReason 
dimension ... so it explicitly means 'no scaling was performed'.
   
   Yes but the metric is a different meaning here. IMO, we should not be 
emitting a metric if we explicitly don't want to scale/don't want to make a 
decision on scaling. The metric being emitted means we wanted to scale up/down 
to some value that's outside the bounds of our spec. The value being `-1` 
implies something else.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to