You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Status

Current stateUnder Discussion

Discussion threadhttps://lists.apache.org/thread.html/e206390127bcbd9b24d9c41a838faa75157e468e01552ad241e3e24b@%3Cdev.flink.apache.org%3E

JIRA: FLINK-13921

Released:

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Currently, Flink's behaviour with respect to configuring the RestartStrategies is quite complicated and convoluted. The reason for this is that we evolved the way it has been configured and wanted to keep it backwards compatible. Due to this, we have currently the following behaviour:

  • If the config option `restart-strategy` is configured, then Flink uses this `RestartStrategy` (so far so simple)
  • If the config option `restart-strategy` is not configured, then 
    • If `restart-strategy.fixed-delay.attempts` or `restart-strategy.fixed-delay.delay` are defined, then instantiate `FixedDelayRestartStrategy(restart-strategy.fixed-delay.attempts, restart-strategy.fixed-delay.delay)`
    • If `restart-strategy.fixed-delay.attempts` and `restart-strategy.fixed-delay.delay` are not defined, then
      • If checkpointing is disabled, then choose `NoRestartStrategy`
      • If checkpointing is enabled, then choose `FixedDelayRestartStrategy(Integer.MAX_VALUE, "0 s")`

Proposed Changes

I would like to simplify the configuration by removing the "If `restart-strategy.fixed-delay.attempts` or `restart-strategy.fixed-delay.delay`, then" condition. That way, the logic would be the following:

  • If the config option `restart-strategy` is configured, then Flink uses this `RestartStrategy`
  • If the config option `restart-strategy` is not configured, then 
    • If checkpointing is disabled, then choose `NoRestartStrategy`
    • If checkpointing is enabled, then choose `FixedDelayRestartStrategy(Integer.MAX_VALUE, "0 s")`

That way we retain the user friendliness that jobs restart if the user enabled checkpointing and we make it clear that any `restart-strategy.fixed-delay.xyz` setting will only be respected if `restart-strategy` has been set to `fixed-delay`.

Compatibility, Deprecation, and Migration Plan

This simplification would, however, change Flink's behaviour and might break existing setups. Since we introduced `RestartStrategies` with Flink 1.0.0 and deprecated the prior configuration mechanism which enables restarting if either the `attempts` or the `delay` has been set, I think that the number of broken jobs should be minimal if not non-existent.

Test Plan

RestartStrategyFactory.createRestartStrategy needs to be tested since it is currently not covered by tests.


Rejected Alternatives

None

  • No labels