gyfora commented on code in PR #721:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/721#discussion_r1412894510
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractFlinkResourceReconciler.java:
##########
@@ -186,7 +187,41 @@ private void applyAutoscaler(FlinkResourceContext<CR> ctx)
throws Exception {
ctx.getResource().getSpec().getJob() != null
&&
ctx.getObserveConfig().getBoolean(AUTOSCALER_ENABLED);
autoScalerCtx.getConfiguration().set(AUTOSCALER_ENABLED,
autoscalerEnabled);
+
autoscaler.scale(autoScalerCtx);
+ putBackOldParallelismOverridesIfNewOnesAreMerelyAPermutation(ctx);
+ }
+
+ private static <
+ CR extends AbstractFlinkResource<SPEC, STATUS>,
+ SPEC extends AbstractFlinkSpec,
+ STATUS extends CommonStatus<SPEC>>
+ void putBackOldParallelismOverridesIfNewOnesAreMerelyAPermutation(
Review Comment:
Could we move this logic to the `ScalingRealizer`?
https://github.com/apache/flink-kubernetes-operator/commit/158cbe29169cbfb7fa7ad676fb0273fd7ef6d25e
adds the logic there and this issue comes from that change. I feel these 2
changes logically belong together and it's weird that we break something in
once place and fix it in another while it could be simply next to each other.
It will likely also make the whole logic a bit simpler
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractFlinkResourceReconciler.java:
##########
@@ -186,7 +187,41 @@ private void applyAutoscaler(FlinkResourceContext<CR> ctx)
throws Exception {
ctx.getResource().getSpec().getJob() != null
&&
ctx.getObserveConfig().getBoolean(AUTOSCALER_ENABLED);
autoScalerCtx.getConfiguration().set(AUTOSCALER_ENABLED,
autoscalerEnabled);
+
autoscaler.scale(autoScalerCtx);
+ putBackOldParallelismOverridesIfNewOnesAreMerelyAPermutation(ctx);
+ }
+
+ private static <
+ CR extends AbstractFlinkResource<SPEC, STATUS>,
+ SPEC extends AbstractFlinkSpec,
+ STATUS extends CommonStatus<SPEC>>
Review Comment:
Can we rename this to `resetParallelismOverridesIfUnchanged` ? The current
naming is unusually verbose for the codebase. It may be better to add a javadoc
comment instead. But this may be irrelevant if you check my other comment. We
don't need to replace it if we don't set it in the first place, but for that we
need to move the logic
--
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]