This is an automated email from the ASF dual-hosted git repository. panyuepeng pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
commit 897f8edafff39e19ccc51eae9b1b7b065f5d3a19 Author: Pan Yuepeng <[email protected]> AuthorDate: Wed Jul 30 00:50:45 2025 +0800 [FLINK-38341][configuration] Introduce the rescale history configuration option. Co-authored-by: XComp <[email protected]> Co-authored-by: ferenc-csaky <[email protected]> Signed-off-by: Yuepeng Pan <[email protected]> --- .../shortcodes/generated/all_jobmanager_section.html | 6 ++++++ docs/layouts/shortcodes/generated/web_configuration.html | 6 ++++++ .../java/org/apache/flink/configuration/WebOptions.java | 14 ++++++++++++++ .../runtime/scheduler/adaptive/AdaptiveScheduler.java | 3 +-- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/layouts/shortcodes/generated/all_jobmanager_section.html b/docs/layouts/shortcodes/generated/all_jobmanager_section.html index d16e2058cc6..87d8875a6df 100644 --- a/docs/layouts/shortcodes/generated/all_jobmanager_section.html +++ b/docs/layouts/shortcodes/generated/all_jobmanager_section.html @@ -158,6 +158,12 @@ <td><p>Enum</p></td> <td>Determines which scheduler implementation is used to schedule tasks. If this option is not explicitly set, batch jobs will use the 'AdaptiveBatch' scheduler as the default, while streaming jobs will default to the 'Default' scheduler. <br /><br />Possible values:<ul><li>"Default": Default scheduler</li><li>"Adaptive": Adaptive scheduler. More details can be found <a href="{{.Site.BaseURL}}{{.Site.LanguagePrefix}}/docs/deployment/elastic_scaling#adaptive-scheduler">here</a [...] </tr> + <tr> + <td><h5>web.adaptive-scheduler.rescale-history.size</h5></td> + <td style="word-wrap: break-word;">0</td> + <td>Integer</td> + <td>The maximum number of the rescale records per job whose scheduler is <code class="highlighter-rouge">Adaptive</code>. The feature will be disabled when the configuration value is smaller or equals to 0.</td> + </tr> <tr> <td><h5>web.exception-history-size</h5></td> <td style="word-wrap: break-word;">16</td> diff --git a/docs/layouts/shortcodes/generated/web_configuration.html b/docs/layouts/shortcodes/generated/web_configuration.html index faeb45e392d..38cf3c34a80 100644 --- a/docs/layouts/shortcodes/generated/web_configuration.html +++ b/docs/layouts/shortcodes/generated/web_configuration.html @@ -14,6 +14,12 @@ <td>String</td> <td>Access-Control-Allow-Origin header for all responses from the web-frontend.</td> </tr> + <tr> + <td><h5>web.adaptive-scheduler.rescale-history.size</h5></td> + <td style="word-wrap: break-word;">0</td> + <td>Integer</td> + <td>The maximum number of the rescale records per job whose scheduler is <code class="highlighter-rouge">Adaptive</code>. The feature will be disabled when the configuration value is smaller or equals to 0.</td> + </tr> <tr> <td><h5>web.cancel.enable</h5></td> <td style="word-wrap: break-word;">true</td> diff --git a/flink-core/src/main/java/org/apache/flink/configuration/WebOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/WebOptions.java index e53de835f1b..ee5b7391ab3 100644 --- a/flink-core/src/main/java/org/apache/flink/configuration/WebOptions.java +++ b/flink-core/src/main/java/org/apache/flink/configuration/WebOptions.java @@ -141,6 +141,20 @@ public class WebOptions { .withDescription( "The maximum number of failures collected by the exception history per job."); + /** The maximum number of the adaptive scheduler rescale history. */ + @Documentation.Section(Documentation.Sections.ALL_JOB_MANAGER) + public static final ConfigOption<Integer> MAX_ADAPTIVE_SCHEDULER_RESCALE_HISTORY_SIZE = + key("web.adaptive-scheduler.rescale-history.size") + .intType() + .defaultValue(0) + .withDescription( + Description.builder() + .text( + "The maximum number of the rescale records per job whose scheduler is %s. " + + "The feature will be disabled when the configuration value is smaller or equals to 0.", + code(JobManagerOptions.SchedulerType.Adaptive.name())) + .build()); + /** Timeout for asynchronous operations by the web monitor in milliseconds. */ public static final ConfigOption<Duration> TIMEOUT = key("web.timeout") diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java index 3c214de4a16..153d99c8f85 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java @@ -314,8 +314,7 @@ public class AdaptiveScheduler SCHEDULER_RESCALE_TRIGGER_MAX_DELAY, maximumDelayForRescaleTriggerDefault), rescaleOnFailedCheckpointsCount, - // TODO: The parameter passing link will be implemented after FLIP-495. - -1); + configuration.get(WebOptions.MAX_ADAPTIVE_SCHEDULER_RESCALE_HISTORY_SIZE)); } private final SchedulerExecutionMode executionMode;
