[release-0.2][runtime] Prune restored processing keys before snapshot#826
Merged
wenjin272 merged 1 commit intoJun 10, 2026
Conversation
c791b3d to
8ec6b59
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.
Linked issue: #824
Purpose of change
This is the release-0.2 follow-up for #825.
This PR fixes duplicate processing-key recovery after rescale or restore.
currentProcessingKeysOpStateis union list state, so every restored subtask sees the union of all previous subtasks' processing keys. The existing restore logic skips non-owned keys when scheduling recovery work, but non-owner subtasks still kept those keys in their local operator state. If a checkpoint is taken before the owner finishes the key, non-owner subtasks can snapshot stale processing keys again. A later restore can then see duplicate entries for the same key, causing duplicate recovery mailbox submissions and eventually makingremoveProcessingKeyreturn a count greater than one.The fix keeps only distinct keys owned by the current subtask in the local operator state after restore. This prevents non-owner subtasks from re-publishing stale keys into later checkpoints.
Tests
mvn -pl runtime -am -Dtest=ActionExecutionOperatorTest#testRestoreOnlyResumesKeysOwnedByCurrentSubtask -Dsurefire.failIfNoSpecifiedTests=false testmvn -pl runtime -am -Dtest=ActionExecutionOperatorTest -Dsurefire.failIfNoSpecifiedTests=false testAPI
No public API changes.
Documentation
doc-neededdoc-not-neededdoc-included