[Reset] Handle completion events from restarted children#7295
Closed
[Reset] Handle completion events from restarted children#7295
Conversation
yycptt
reviewed
Feb 10, 2025
| return nil, consts.ErrChildExecutionNotFound | ||
| } | ||
| initiatedAttr := initiatedEvent.GetStartChildWorkflowExecutionInitiatedEventAttributes() | ||
| childID := fmt.Sprintf("%s:%s", initiatedAttr.GetWorkflowType().Name, initiatedAttr.GetWorkflowId()) |
Member
There was a problem hiding this comment.
nit: we really should create a util function for this concatenation logic. I think I've seen it in 3 different places.
| childrenInitializedAfterResetPoint := mutableState.GetChildrenInitializedPostResetPoint() | ||
| if len(childrenInitializedAfterResetPoint) > 0 { | ||
| // This parent was reset and it also has some children that potentially were restarted. | ||
| initiatedEvent, err := mutableState.GetChildExecutionInitiatedEvent(ctx, parentInitiatedID) |
Member
There was a problem hiding this comment.
hmm I don't think we need to load the initiatedEvent. Both child workflow type and child workflowID are available in ChildExecutionInfo in mutable state I think.
| } | ||
| // The results are from the child that this parent initiated. We should stop tracking the child and process the result now. | ||
| delete(childrenInitializedAfterResetPoint, childID) | ||
| mutableState.SetChildrenInitializedPostResetPoint(childrenInitializedAfterResetPoint) |
Member
There was a problem hiding this comment.
plz update ms.approximateSize when setting the reset point.
|
This PR was marked as stale. Please update or close it. |
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.
What changed?
In this PR we are doing 2 things,
ChildrenInitializedPostResetPointWhy?
How did you test it?
Added unit tests + manual testing.
Potential risks
N/A
Documentation
Pending
Is hotfix candidate?
No