huyuanfeng2018 commented on code in PR #904:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/904#discussion_r1848477399
##########
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:
> Why the `upperBoundForAlignment` logic is updated? Would you mind sharing
one case?
When I ran the test case, i found this logic is wrong when keygroups or
partitionnum are not even numbers.
--
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]