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

Add staleness check to RecordChildExecutionCompleted #5955

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

Shaddoll
Copy link
Member

What changed?
Add staleness check to RecordChildExecutionCompleted

Why?
During the transitioning of the ownership of a shard, a request may be routed to the old owner which has the stale mutable state. And if a non-retriable error is returned from the old owner, the parent workflow will lose the child workflow completion event.

How did you test it?
unit tests

Potential risks

Release notes

Documentation Changes

if ci.StartedID == common.EmptyEventID {
if startedID >= mutableState.GetNextEventID() {
e.metricsClient.IncCounter(metrics.HistoryRecordChildExecutionCompletedScope, metrics.StaleMutableStateCounter)
e.logger.Error("Encounter stale mutable state in RecordChildExecutionCompleted",
Copy link
Member

Choose a reason for hiding this comment

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

I'd use a different message here to distinguish from the above case

Copy link
Member Author

Choose a reason for hiding this comment

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

will do in a separate pr

@Shaddoll Shaddoll merged commit b567432 into cadence-workflow:master Apr 29, 2024
18 checks passed
@Shaddoll Shaddoll deleted the fix-child branch April 29, 2024 19:59
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.

2 participants