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

[Dubbo-6481]Fix Extended LoadBalance ran 2 times during service call #7192

Merged
merged 2 commits into from
Feb 20, 2021
Merged

[Dubbo-6481]Fix Extended LoadBalance ran 2 times during service call #7192

merged 2 commits into from
Feb 20, 2021

Conversation

zhangyz-hd
Copy link
Contributor

ZoneAwareClusterInvoker在选择注册中心时,使用配置的loadbalance,而不使用service属性中的loadbalance。

What is the purpose of the change

To fix #6481

Brief changelog

当配置了多个注册中心时,ZoneAwareClusterInvoker会使用LoadBalance对多个注册中心进行一次筛选。
原是使用当前服务对应的loadbalance,当服务配置了自己的loadbalance时,ZoneAwareClusterInvoker就错误选择了服务的loadbalance区筛选注册中心。
现改为由LOADBALANCE_AMONG_REGISTRIES配置项的loadbalance(默认random)。

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

ZoneAwareClusterInvoker在选择注册中心时,使用配置的loadbalance,而不使用service属性中的loadbalance。
提取到loadBalanceAmongRegistries,避免每次getExtension()
@chickenlj chickenlj merged commit 9cecbc3 into apache:master Feb 20, 2021
@zhangyz-hd zhangyz-hd deleted the fix_6481 branch July 5, 2021 02:22
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.

Extended LoadBalance ran 2 times during service call
2 participants