You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "BewareMyPower (via GitHub)" <gi...@apache.org> on 2024/04/22 13:18:23 UTC
[PR] [improve][broker] Make BrokerSelectionStrategy pluggable [pulsar]
BewareMyPower opened a new pull request, #22553:
URL: https://github.com/apache/pulsar/pull/22553
### Motivation
When users want to extend the `ExtensibleLoadManagerImpl`, the `BrokerSelectionStrategy` cannot be customized, so users have to write much duplicated code for a customized broker selection strategy.
### Modifications
Add a stable interface `BrokerSelectionStrategyFactory` and implements this interface in `ExtensibleLoadManagerImpl` with the default implementation that returns a `LeastResourceUsageWithWeight` instance by default. Add `CustomBrokerSelectionStrategyTest` to show how to customize the broker selection strategy and verify it works.
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [x] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
### Documentation
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: <!-- ENTER URL HERE -->
<!--
After opening this PR, the build in apache/pulsar will fail and instructions will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed in
a forked repository.
The tests will be run in the forked repository until all PR review comments have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][broker] Make BrokerSelectionStrategy pluggable [pulsar]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower merged PR #22553:
URL: https://github.com/apache/pulsar/pull/22553
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][broker] Make BrokerSelectionStrategy pluggable [pulsar]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on PR #22553:
URL: https://github.com/apache/pulsar/pull/22553#issuecomment-2071455028
```
Error: Failures:
Error: org.apache.pulsar.broker.loadbalance.extensions.strategy.CustomBrokerSelectionStrategyTest.testSingleBrokerSelected
[INFO] Run 1: PASS
Error: Run 2: CustomBrokerSelectionStrategyTest.testSingleBrokerSelected:71 expected [34517] but found [38481]
```
It seems this test is flaky. I will check the failure soon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][broker] Make BrokerSelectionStrategy pluggable [pulsar]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on PR #22553:
URL: https://github.com/apache/pulsar/pull/22553#issuecomment-2071585235
The test failed because the broker selection strategy of `CustomExtensibleLoadManager ` chooses the broker with the smallest **HTTP listen port**, while the test uses the `PulsarService` instance with the smallest **binary listen port** as the expected broker. I fixed it now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org