kfaraz commented on code in PR #14545:
URL: https://github.com/apache/druid/pull/14545#discussion_r1255552785


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/RemoteTaskRunner.java:
##########
@@ -1401,29 +1401,31 @@ public Collection<Worker> 
markWorkersLazy(Predicate<ImmutableWorkerInfo> isLazyW
   {
     // skip the lock and bail early if we should not mark any workers lazy 
(e.g. number
     // of current workers is at or below the minNumWorkers of autoscaler 
config)
-    if (maxLazyWorkers < 1) {
-      return Collections.emptyList();
+    if (lazyWorkers.size() >= maxLazyWorkers) {
+      return getLazyWorkers();

Review Comment:
   I think we should return a sub-list here of size `maxLazyWorkers`. 
Otherwise, the strategy could potentially terminate all the lazy workers and 
not just those which are in excess.
   
   This would probably be okay if the value of `maxLazyWorkers` passed was 
always the same. In that case, we would only ever mark a worker as lazy if it 
was in excess of `maxLazyWorkers`. But if the value of `maxLazyWorkers` 
decreases in subsequent invocations of this method, we would do some extra 
terminations.



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