-
Notifications
You must be signed in to change notification settings - Fork 801
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
update startedEventId in buffered events #392
update startedEventId in buffered events #392
Conversation
Changes Unknown when pulling 96474b1 on yiminc:update_startedEventId_in_history into ** on uber:master**. |
case workflow.EventTypeActivityTaskStarted: | ||
// need to update startedEventId in mutableState if it is still there | ||
scheduledEventId := event.ActivityTaskStartedEventAttributes.GetScheduledEventId() | ||
if ai, ok := e.GetActivityInfo(scheduledEventId); ok { |
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.
Can you check if creating 2 updates in the same transaction for same activityInfo will work?
e.updateActivityInfos = append(e.updateActivityInfos, ai) | ||
} | ||
// update subsequent buffered events in this batch that have reference to the startedEventId | ||
for j := i + 1; j < len(newCommittedEvents); j++ { |
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.
I think we should be able to update all events in a single pass. I'm not sure this N^2 algorithm is needed here.
for j := i + 1; j < len(newCommittedEvents); j++ { | ||
closeEvent := newCommittedEvents[j] | ||
switch closeEvent.GetEventType() { | ||
case workflow.EventTypeChildWorkflowExecutionCompleted: |
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.
I think there is one more event 'StartChildWorkflowExecutionFailedEvent'
Changes Unknown when pulling eee50fe on yiminc:update_startedEventId_in_history into ** on uber:master**. |
update startedEventId in buffered events.