-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update replication task rate limiter priority based on active/standby… #8978
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
base: main
Are you sure you want to change the base?
Conversation
service/history/queues/scheduler.go
Outdated
| namespaceName = ns.Name().String() | ||
| } | ||
| if ns.ActiveInCluster(clusterMetadata.GetCurrentClusterName()) { | ||
| return quotas.NewRequest(e.GetType().String(), taskSchedulerToken, namespaceName, e.GetPriority().CallerType(), 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.
This is not changed
service/history/queues/scheduler.go
Outdated
| if ns.ActiveInCluster(clusterMetadata.GetCurrentClusterName()) { | ||
| return quotas.NewRequest(e.GetType().String(), taskSchedulerToken, namespaceName, e.GetPriority().CallerType(), 0, "") | ||
| } else { | ||
| return quotas.NewRequest(e.GetType().String(), taskSchedulerToken, namespaceName, headers.CallerTypePreemptable, 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.
Use lowest level for standby tasks
service/history/queues/scheduler.go
Outdated
| } | ||
|
|
||
| return quotas.NewRequest(e.GetType().String(), taskSchedulerToken, namespaceName.String(), e.GetPriority().CallerType(), 0, "") | ||
| if ns.ActiveInCluster(clusterMetadata.GetCurrentClusterName()) { |
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.
will this cause NPE if ns is nil?
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.
hmm guess ideally we should only set priority once on creation and later when failover happens.
The whole activeness check for task processing probably needs to be refactored.
I think for now, can we move this logic into priority assigner and also update priority here?
service/history/queues/scheduler.go
Outdated
| rateLimiter SchedulerRateLimiter, | ||
| timeSource clock.TimeSource, | ||
| chasmRegistry *chasm.Registry, | ||
| clusterMetadata cluster.Metadata, |
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.
shall we just pass in current cluster name here and avoid getting it from clusterMetadata for each task?
What changed?
Update replication task rate limiter priority based on active/standby state
Why?
The replication task should have higher priority than standby task
How did you test it?
Potential risks
There is a task processing priority change requires review