huyuanfeng2018 commented on code in PR #904:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/904#discussion_r1848503819


##########
flink-autoscaler/src/main/java/org/apache/flink/autoscaler/JobVertexScaler.java:
##########
@@ -411,26 +416,30 @@ protected static <KEY, Context extends 
JobAutoScalerContext<KEY>> int scale(
 
         var numKeyGroupsOrPartitions =
                 numSourcePartitions <= 0 ? maxParallelism : 
numSourcePartitions;
-        var upperBoundForAlignment =
-                Math.min(
-                        // Optimize the case where newParallelism <= 
maxParallelism / 2
-                        newParallelism > numKeyGroupsOrPartitions / 2
-                                ? numKeyGroupsOrPartitions
-                                : numKeyGroupsOrPartitions / 2,
-                        upperBound);
+
+        KeyGroupOrPartitionsAdjustMode mode =
+                
context.getConfiguration().get(SCALING_KEY_GROUP_PARTITIONS_ADJUST_MODE);
+
+        var upperBoundForAlignment = Math.min(numKeyGroupsOrPartitions, 
upperBound);

Review Comment:
   Let me give you an example:
   
   partition=199, newParallelism=96 
   At this time, the original logical `upperBoundForAlignment` will be 
calculated as 99,
   
   But under EVENLY_SPREAD, I think the result is 199 as expected
   
   Under MAXIMIZE_UTILISATION, the result is 100 as expected,
   
   But due to this wrong logic, we cannot get the expected results. This is a 
bug. If it is not appropriate to fix it in this PR, is it necessary to fix it 
in another PR?
   



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