Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly update workflow transition history #5885

Merged
merged 3 commits into from May 21, 2024

Conversation

yycptt
Copy link
Member

@yycptt yycptt commented May 9, 2024

What changed?

  • Properly update workflow transition history.
  • Only update transition history when closing transaction as active
  • Only update updates to replicated application state as state transition (NOTE: this is a different concept from the existing state transition counter we have in executionInfo, which is simply how many times the mutable state object got updated.)
    • When sub state machine tree is dirty
    • When history event got generated.
    • When there's sync activity
    • All other changes are either system level field update or not replicated (e.g. buffer events or transient workflow task)

Why?

  • State-based replication rely on all clusters agree on the same transition history. and replication task processing logic relies on the transition history to detect missing or conflicting state transitions.

How did you test it?

  • Existing tests
  • Added unit tests

Potential risks

  • State transition history is behind a feature flag so no risk.

Documentation

  • N/A

Is hotfix candidate?

  • No

@yycptt yycptt marked this pull request as ready for review May 14, 2024 00:49
@yycptt yycptt requested a review from a team as a code owner May 14, 2024 00:49
service/history/workflow/mutable_state_impl.go Outdated Show resolved Hide resolved
@yycptt yycptt merged commit d7d6d9e into temporalio:main May 21, 2024
42 checks passed
@yycptt yycptt deleted the wf-transition-history branch May 21, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants