Files
Yichao YangandGitHub f65fc5983c Properly update workflow transition history (#5885)
## What changed?
<!-- Describe what has changed in this PR -->
- 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?
<!-- Tell your future self why have you made these changes -->
- 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?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
- Existing tests
- Added unit tests

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
- State transition history is behind a feature flag so no risk.

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
- N/A

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
- No
2024-05-21 13:38:44 -07:00
..