-
Notifications
You must be signed in to change notification settings - Fork 805
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 weighted load balancer #6522
base: master
Are you sure you want to change the base?
Conversation
@@ -563,18 +570,7 @@ func (c *taskListManagerImpl) GetTask( | |||
return nil, fmt.Errorf("couldn't get task: %w", err) | |||
} | |||
task.domainName = c.domainName | |||
// according to Little's Law, the average number of tasks in the queue L = λW |
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.
the following code is moved to weighted load balancer
@@ -165,8 +166,8 @@ func (lb *weightedLoadBalancer) PickReadPartition( | |||
if !ok { | |||
return lb.fallbackLoadBalancer.PickReadPartition(domainID, taskList, taskListType, forwardedFrom) | |||
} | |||
p := w.pick() | |||
lb.logger.Debug("pick read partition", tag.WorkflowDomainID(domainID), tag.WorkflowTaskListName(taskList.GetName()), tag.WorkflowTaskListType(taskListType), tag.Dynamic("weights", w.weights), tag.Dynamic("tasklist-partition", p)) |
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.
w.weights cannot be accessed without lock being held, so update the pick method to return cumulativeWeights for debugging
Detailed Description
Impact Analysis
Testing Plan
Rollout Plan
What?
The main purpose of this PR is to update weighted load balancer to support activity task list. A new proto type is introduced for this purpose and some refactoring is done to make the code more readable.
Test
This PR has unit tests for all components. The end-to-end tests was done manually by running workflows in dev2.