1996fanrui commented on code in PR #904:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/904#discussion_r1849383882
##########
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:
It's seems it's wrong logic when numKeyGroupsOrPartitions is odd number.
Thanks for the clarification! This change makes sense to me.
--
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]