Skip to content

[release-0.2][runtime] Prune restored processing keys before snapshot#826

Merged
wenjin272 merged 1 commit into
apache:release-0.2from
joeyutong:codex/fix-processing-key-union-state-release-0.2
Jun 10, 2026
Merged

[release-0.2][runtime] Prune restored processing keys before snapshot#826
wenjin272 merged 1 commit into
apache:release-0.2from
joeyutong:codex/fix-processing-key-union-state-release-0.2

Conversation

@joeyutong

@joeyutong joeyutong commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

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.

currentProcessingKeysOpState is 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 making removeProcessingKey return 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 test
  • mvn -pl runtime -am -Dtest=ActionExecutionOperatorTest -Dsurefire.failIfNoSpecifiedTests=false test

API

No public API changes.

Documentation

  • doc-needed
  • doc-not-needed
  • doc-included

@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs fixVersion/0.2.2 priority/major Default priority of the PR or issue. labels Jun 10, 2026
@joeyutong joeyutong added fixVersion/0.2.1 The feature or bug should be implemented/fixed in the 0.2.1 version. and removed fixVersion/0.2.2 labels Jun 10, 2026
@joeyutong joeyutong force-pushed the codex/fix-processing-key-union-state-release-0.2 branch from c791b3d to 8ec6b59 Compare June 10, 2026 02:48
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-not-needed Your PR changes do not impact docs labels Jun 10, 2026
@wenjin272 wenjin272 added fixVersion/0.2.2 and removed fixVersion/0.2.1 The feature or bug should be implemented/fixed in the 0.2.1 version. labels Jun 10, 2026

@wenjin272 wenjin272 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenjin272 wenjin272 merged commit 47fd098 into apache:release-0.2 Jun 10, 2026
22 checks passed
@joeyutong joeyutong deleted the codex/fix-processing-key-union-state-release-0.2 branch June 10, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs fixVersion/0.2.2 priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants