-
Notifications
You must be signed in to change notification settings - Fork 911
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
Move update registry from mutable state to workflow context #4032
Move update registry from mutable state to workflow context #4032
Conversation
@@ -144,6 +145,8 @@ type ( | |||
ctx context.Context, | |||
now time.Time, | |||
) error | |||
// TODO (alex-update): move this from workflow context. |
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 is because long term goal is to to store registry out of workflow cache.
@@ -193,17 +181,6 @@ func (r *RegistryImpl) getAcceptedUpdateNoLock(protocolInstanceID string) *Updat | |||
return nil | |||
} | |||
|
|||
func (r *RegistryImpl) clearFailure() *failurepb.Failure { |
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 is not needed anymore.
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.
One nit that doesn't block
@@ -754,6 +755,7 @@ func (handler *workflowTaskHandlerCallbacksImpl) verifyFirstWorkflowTaskSchedule | |||
|
|||
func (handler *workflowTaskHandlerCallbacksImpl) createRecordWorkflowTaskStartedResponse( | |||
ms workflow.MutableState, | |||
updateRegistry update.Registry, |
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.
Minor and not blocking - this seems out of place here. Maybe better to pass the full workflow context and then extract the MS and registry within the function body?
What changed?
Move update registry from mutable state to workflow context.
Why?
When workflow task is failed, mutable state is cleared and refreshed. This also clears update registry which might have updates not related to failed workflow task.
This PR moves updated registry one level above -- to workflow context. This allows mutable state to be cleared w/o clearing update registry.
How did you test it?
Modified integration test.
Potential risks
No risks.
Is hotfix candidate?
No.