Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Shaddoll
Copy link
Member

@Shaddoll Shaddoll commented Nov 25, 2024

Detailed Description

  • Define new proto message LoadBalancerHints
  • Add LoadBalancerHints to PollForActivityTaskResponse and PollForDecisionTaskResponse

Impact Analysis

  • Backward Compatibility: Yes.
  • Forward Compatibility: Yes.

Testing Plan

  • Unit Tests: Yes.
  • Persistence Tests: No.
  • Integration Tests: Planned to add simulation test in a separate PR to cover this.
  • Compatibility Tests: No.

Rollout Plan

  • What is the rollout plan?
  • Does the order of deployment matter? No.
  • Is it safe to rollback? Does the order of rollback matter? It's safe to rollback and the order doesn't matter.
  • Is there a kill switch to mitigate the impact immediately? We don't need a kill switch.

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.

@@ -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
Copy link
Member Author

@Shaddoll Shaddoll Nov 25, 2024

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))
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant