-
Notifications
You must be signed in to change notification settings - Fork 846
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
Fix task state change for state based replication #6816
base: main
Are you sure you want to change the base?
Conversation
ms.approximateSize += ai.Size() - prev.Size() | ||
return nil | ||
} | ||
func (ms *MutableStateImpl) UpdateActivityTimerTaskStatus( |
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: let's add some comment on UpdateActivity()
saying it ideally should not be used and if used, can only be used when user data needs to be changed. Same for UpdateUserTimer()
ai.TimerTaskStatus = status | ||
ms.updateActivityInfos[ai.ScheduledEventId] = ai | ||
return nil | ||
} | ||
|
||
// UpdateActivityWithTimerHeartbeat updates an activity | ||
func (ms *MutableStateImpl) UpdateActivityWithTimerHeartbeat( |
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 method needs to call UpdateActivityTimerTaskStatus
as well.
updateActivityInfosUserDataUpdated map[int64]struct{} | ||
updateTimerInfosUserDataUpdated map[string]struct{} |
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:
updateActivityInfosUserDataUpdated map[int64]struct{} | |
updateTimerInfosUserDataUpdated map[string]struct{} | |
activityInfosUserDataUpdated map[int64]struct{} | |
timerInfosUserDataUpdated map[string]struct{} |
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.
Plz also add some comment explaining why we need this in addition to updateActivityInfos
and updateTimerInfos
refreshUserTimerTask = true | ||
|
||
// need to update user timer task mask for which task is generated | ||
if err := mutableState.UpdateUserTimer( | ||
timerInfo, | ||
if err := mutableState.UpdateUserTimerTaskStatus( |
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 believe we have the same logic in this file for clearing activity timer task status, that needs to be updated as well.
@@ -450,12 +450,12 @@ func (r *TaskRefresherImpl) refreshTasksForTimer( | |||
} | |||
|
|||
// clear timer task mask for later timer task re-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.
nit: move the comment as well.
What changed?
Add new api for updating timer task status
Why?
We need to distinguish the user data update and timer task status update because we don't need to update state transition when the change is task status update change.
How did you test it?
unit test
Potential risks
n/a
Documentation
n/a
Is hotfix candidate?
no