[FLINK-39061][example] Roll back StateMachineExample to v1 State API#27936
Merged
Conversation
StateMachineExample was using the State V2 async API (enableAsyncState(), asyncValue(), asyncUpdate(), asyncClear()), which requires the ForSt backend. ForSt is still in development and does not support CANONICAL savepoints, causing an IllegalStateException when one is triggered. Roll back to the v1 synchronous State API, which works with all GA backends and supports all savepoint formats.
Collaborator
Contributor
Author
|
@rmetzger Can you take a look. |
Contributor
Author
|
@seb-pereira @gaborgsomogyi Can you take a look as well, tagging as you participated in the JIRA as well. |
seb-pereira
approved these changes
May 19, 2026
seb-pereira
left a comment
Contributor
There was a problem hiding this comment.
Thanks @spuru9. This change effectively reverts to the v1 State and resolves the issue with creating canonical savepoints.
Contributor
Author
|
@gaborgsomogyi Can you help with the merge. |
Contributor
Author
|
@gaborgsomogyi Is this good for merge? |
gaborgsomogyi
approved these changes
Jun 25, 2026
Contributor
Author
|
@gaborgsomogyi Should I create the backport? |
Contributor
|
Yeah, thanks. |
This was referenced Jun 25, 2026
Contributor
Author
|
@gaborgsomogyi
|
Contributor
|
Please ping me when there is a green run on them |
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
StateMachineExamplewas inadvertently changed to use the State V2 async API(
state.v2.ValueState,enableAsyncState(),asyncValue(),asyncUpdate(),asyncClear()),which requires the ForSt backend. ForSt is still under development and does not yet support
CANONICALsavepoints — triggering one causes anIllegalStateExceptionthat crashes the job.This PR rolls the example back to the v1 synchronous State API, which is GA, works with all
standard backends, and supports all savepoint formats including
CANONICAL.Brief change log
state.v2.ValueState/ValueStateDescriptorimports with the v1 equivalents.enableAsyncState()from thekeyBychain inStateMachineMapperflatMapto use synchronouscurrentState.value(),update(), andclear()instead ofasyncValue().thenAccept(...),asyncUpdate(), andasyncClear()Verifying this change
This change is manually verified.
savepoints when deployed via the K8s Operator.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation