-
Notifications
You must be signed in to change notification settings - Fork 872
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 api at mutable state to track potential reapply events #7001
base: main
Are you sure you want to change the base?
Add api at mutable state to track potential reapply events #7001
Conversation
for _, event := range newRunHistory { | ||
newRunMutableState.AddReapplyCandidateEvent(event) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new run (continue as new) is created by applying events so the history builder in newRunMutableState does contain those events I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense. removed.
service/history/workflow/context.go
Outdated
newWorkflowEventsSeq, | ||
); err != nil { | ||
return err | ||
if len(updateWorkflowEventsSeq) != 0 || len(newWorkflowEventsSeq) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented above, I think newWorkflowEventsSeq is non-empty here.
We need to check both xxxWorkflowEventsSeq and xxxEventReapplyCandidate and pick the non-empty one if existing for the reapply.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
if err := c.updateWorkflowExecutionEventReapply( | ||
ctx, | ||
shardContext, | ||
updateMode, | ||
updateWorkflowEventsSeq, | ||
eventsToReapply, | ||
newWorkflowEventsSeq, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a comment re. why newWorkflowEventsSeq can be used directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
service/history/workflow/context.go
Outdated
// current workflow events will not participate in the events reapplication | ||
); err != nil { | ||
return err | ||
if len(resetWorkflowEventsSeq) != 0 || len(newWorkflowEventsSeq) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should use similar logic as UpdateWorkflowExecutionWithNew?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! updated as UpdateWorkflowExecutionWithNew
if err != nil { | ||
return common.EmptyEventTaskID, nil, err | ||
} | ||
eventsToReapply = append(eventsToReapply, events...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is it possible to add those events directly to ms here instead of buffering entire history in memory, return and then filter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restructure the functions to add events directly to ms
What changed?
Why?
How did you test it?
Potential risks
Documentation
Is hotfix candidate?