pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[improve][pip] PIP-425: Support connecting with next available endpoint for multi-endpoint serviceUrls

Open AuroraTwinkle opened this issue 7 months ago • 4 comments

Fixes https://github.com/apache/pulsar/issues/22934#issuecomment-2943690398

Main Issue: https://github.com/apache/pulsar/issues/22934#issuecomment-2943690398

Implementation: https://github.com/apache/pulsar/pull/24387

Motivation

As https://github.com/apache/pulsar/issues/22934 and https://github.com/apache/pulsar/discussions/22933 mentioned, when most of the nodes in serviceurl are down (but there is at least one available node), creating consumers and producers through PulsarClient will most likely fail. I think this is not as expected. If the code is robust enough, as long as there is one available node, it should be accessible normally. Therefore, this pip is going to optimize the logic, remove unavailable nodes through the feedback mechanism, and improve the success rate of PulsarClient requests.

By the way, https://github.com/apache/pulsar/pull/22935 removes faulty nodes through a regular health check mechanism, but this brings new problems (frequent creation of connections and increased system load), so this solution is abandoned. See https://github.com/apache/pulsar/issues/22934#issuecomment-2943690398 for more details!

Modifications

Verifying this change

  • [x] Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

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
  • [ ] doc-required
  • [x] doc-not-needed
  • [ ] doc-complete

Matching PR in forked repository

PR in forked repository:

AuroraTwinkle avatar Jun 07 '25 09:06 AuroraTwinkle

@AuroraTwinkle Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

github-actions[bot] avatar Jun 07 '25 09:06 github-actions[bot]

Some initial feedback

@lhotari All good suggestions, I will fix them and update later. Thanks for your help!

AuroraTwinkle avatar Jun 09 '25 10:06 AuroraTwinkle

Some initial feedback

Updated!

AuroraTwinkle avatar Jun 09 '25 11:06 AuroraTwinkle

good progress! added some follow up comments

@lhotari Modified and updated as suggested. Thanks!

AuroraTwinkle avatar Jun 09 '25 14:06 AuroraTwinkle

Hi @AuroraTwinkle

The proposal looks good to me. I’ve added a few comments to help clarify the problem and the proposed solution, making it easier to understand.

Ok, I will fix them later, Thanks!

AuroraTwinkle avatar Jun 17 '25 03:06 AuroraTwinkle

Hi @AuroraTwinkle

The proposal looks good to me. I’ve added a few comments to help clarify the problem and the proposed solution, making it easier to understand.

@codelipenghui Very interesting and detailed suggestions, I have fixed them, thank you again!

AuroraTwinkle avatar Jun 17 '25 03:06 AuroraTwinkle

@lhotari @codelipenghui @315157973 We need more votes on the mailing list to close this PIP. Could you please help vote when you have a moment? https://lists.apache.org/thread/c2zvjwf7bqp8nc2rpzbxd4kdtztk23xp

liangyepianzhou avatar Jun 25 '25 06:06 liangyepianzhou