You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "mxm (via GitHub)" <gi...@apache.org> on 2024/03/11 14:07:58 UTC
[PR] [FLINK-34642] Add a test for zero lower utilization boundary [flink-kubernetes-operator]
mxm opened a new pull request, #796:
URL: https://github.com/apache/flink-kubernetes-operator/pull/796
Users recently reported that scale down as "broken". Turned out that `target.utilization` and `target.utilization.boundary` were set to the same value. This prevents scale down entirely, which is expected and desired.
This PR adds a test to verify this behavior to avoid breaking this in the future.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-34642] Add a test for zero lower utilization boundary [flink-kubernetes-operator]
Posted by "mxm (via GitHub)" <gi...@apache.org>.
mxm merged PR #796:
URL: https://github.com/apache/flink-kubernetes-operator/pull/796
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-34642] Add a test for zero lower utilization boundary [flink-kubernetes-operator]
Posted by "gyfora (via GitHub)" <gi...@apache.org>.
gyfora commented on code in PR #796:
URL: https://github.com/apache/flink-kubernetes-operator/pull/796#discussion_r1520023441
##########
flink-autoscaler/src/test/java/org/apache/flink/autoscaler/ScalingExecutorTest.java:
##########
@@ -146,6 +150,55 @@ op1, evaluated(1, 70, 100),
assertFalse(ScalingExecutor.allVerticesWithinUtilizationTarget(evaluated, scalingSummary));
}
+ @Test
+ public void testNoScaleDownOnZeroLowerUtilizationBoundary() throws Exception {
+ var conf = context.getConfiguration();
+ // Target utilization and boundary are identical
+ // which will set the scale down boundary to infinity
+ conf.set(AutoScalerOptions.TARGET_UTILIZATION, 0.6);
+ conf.set(AutoScalerOptions.TARGET_UTILIZATION_BOUNDARY, 0.6);
+
+ var vertex = new JobVertexID();
+ int parallelism = 100;
+ int expectedParallelism = 1;
+ int targetRate = 1000;
+ // Intentionally also set the true processing rate to infinity
+ // to test the boundaries of the scaling condition.
+ double trueProcessingRate = Double.POSITIVE_INFINITY;
+
+ var evaluated =
+ new EvaluatedMetrics(
+ Map.of(vertex, evaluated(parallelism, targetRate, trueProcessingRate)),
+ dummyGlobalMetrics);
+
+ // Verify precondition
+ var scalingSummary =
+ Map.of(
+ vertex,
+ new ScalingSummary(
+ parallelism,
+ expectedParallelism,
+ evaluated.getVertexMetrics().get(vertex)));
+ assertTrue(
+ ScalingExecutor.allVerticesWithinUtilizationTarget(
+ evaluated.getVertexMetrics(), scalingSummary));
+
+ // Execute the full scaling path
+ HashMap<JobVertexID, SortedMap<Instant, ScalingSummary>> scalingHistory = new HashMap<>();
+ Instant now = Instant.now();
+ JobTopology jobTopology =
Review Comment:
you could use `var` on the left hand sides to make this shorter and consistent with the rest of the method
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org