-
Notifications
You must be signed in to change notification settings - Fork 767
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
Decouple StateBuilder from TaskGenerator #4991
Decouple StateBuilder from TaskGenerator #4991
Conversation
3b2d81d
to
2d93890
Compare
@@ -2174,12 +2166,6 @@ func (e *mutableStateBuilder) AddActivityTaskScheduledEvent( | |||
activityStartedScope.IncCounter(metrics.CadenceRequests) | |||
return event, ai, nil, true, true, nil | |||
} | |||
// TODO merge active & passive task generation |
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 will change the behavior of activity local dispatch.
Before, we try dispatch activity task and if it succeeds, we skip the transfer task creation.
After, we always create the transfer task.
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. Good catch.
@@ -4690,8 +4628,7 @@ func (e *mutableStateBuilder) closeTransactionHandleActivityUserTimerTasks( | |||
transactionPolicy TransactionPolicy, |
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.
It seems that we can remove this parameter
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.
Thanks, updated.
What changed?
Decoupled
StateBuilder
fromTaskGenerator
by moving task generation toReplicate<...>
functions on mutable state. Task generation is needed on both active and passive side, so there is no need to call them separately. There were only a few places where active/passive side differs slightly. For them we can simply pass additional flag modifying that behavior. In particular, more attention is needed for:ReplicateWorkflowExecutionStartedEvent
willGenerateDelayedDecisionTasks
only for passive side. Active side does that separately duringAddFirstDecisionTaskScheduled
.GenerateActivityTimerTasks
/GenerateUserTimerTasks
was called. This can be skipped here, and instead call when closing a transaction. Previously it was not done due totransactionPolicy == TransactionPolicyPassive
, now this is removed. And they will be generated for both active/passive cases.Why?
// TODO merge active & passive task generation
.How did you test it?
Existing tests
Potential risks
Release notes
Documentation Changes