[FLINK-38049] Fix stateless job incorrectly using last-state restore when HA is enabled#1147
Draft
lucasgameiroborges wants to merge 1 commit into
Draft
Conversation
lucasgameiroborges
force-pushed
the
fix/flink-38049-stateless-ha-resubmit
branch
4 times, most recently
from
June 23, 2026 13:51
52e18d6 to
a92052b
Compare
…when HA is enabled When HA is enabled and a stateless job is resubmitted due to being unhealthy, resubmitJob unconditionally set the upgrade mode to LAST_STATE and required HA metadata, ignoring the configured STATELESS upgrade mode. Now both the mode override and the requireHaMetadata flag are skipped when the spec is STATELESS.
lucasgameiroborges
force-pushed
the
fix/flink-38049-stateless-ha-resubmit
branch
from
June 23, 2026 13:53
a92052b to
eb5241a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
When HA is enabled and a stateless job is resubmitted (e.g. due to an unhealthy cluster),
resubmitJobunconditionally overrode the upgrade mode toLAST_STATEand passedrequireHaMetadata=truetorestoreJob, ignoring the user-configuredSTATELESSupgrade mode. This caused the job to attempt a last-state restore from HA metadata instead of starting fresh.Brief change log
AbstractJobReconciler#resubmitJob: skip theLAST_STATEmode override and therequireHaMetadataflag when the spec's upgrade mode isSTATELESSApplicationReconcilerTest#testRestartUnhealthyStatelessJobWithHaEnabledto reproduce the scenario: a stateless job with HA enabled is resubmitted after an unhealthy event with no HA metadata available — previously this would throwUpgradeFailureException, now it succeedsVerifying this change
New unit test
testRestartUnhealthyStatelessJobWithHaEnabledinApplicationReconcilerTestcovers the fix. ExistingApplicationReconcilerTestandApplicationReconcilerUpgradeModeTestsuites (109 tests total) continue to pass.Does this pull request potentially affect one of the following areas
This is a fix for FLINK-38049.