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

[fix][client] fix client with multiple serviceUrl can not connect to server permanently when one broker shutdown #20509

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TakaHiR07
Copy link
Contributor

@TakaHiR07 TakaHiR07 commented Jun 6, 2023

Fixes #20508

Motivation

Fix the single point of failure in pulsar client.

If client config with multiple serviceUrl, it should retry connect successfully when only one broker in config shutdown.

Modifications

  1. When client getConnection of topicName, each topicName use different serviceUrl index to do retry operation. Which make sure the retry logic is roundrobin, but not random
  2. add unit test to test this bug case

There is still something to do, such as simplify the api method, and deprecate the previous getConnection(topic) method. But I think it is better to discuss this fix first and implement them in additional pr.

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)
  • 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
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: TakaHiR07#9

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jun 6, 2023
@TakaHiR07 TakaHiR07 force-pushed the fix_connect_fail_with_multiple_serviceUrl branch from e6608f4 to 6180556 Compare June 6, 2023 12:15
@TakaHiR07 TakaHiR07 changed the title [fix] [client] fix client with multiple serviceUrl can not connect to server when one broker shutdown [fix] [client] fix client with multiple serviceUrl can not connect to server permanently when one broker shutdown Jun 7, 2023
@TakaHiR07 TakaHiR07 changed the title [fix] [client] fix client with multiple serviceUrl can not connect to server permanently when one broker shutdown [fix][client] fix client with multiple serviceUrl can not connect to server permanently when one broker shutdown Jun 9, 2023
@github-actions
Copy link

The pr had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label Jul 10, 2023
@Technoboy- Technoboy- added this to the 3.2.0 milestone Jul 31, 2023
@Technoboy- Technoboy- modified the milestones: 3.2.0, 3.3.0 Dec 22, 2023
@coderzc coderzc modified the milestones: 3.3.0, 3.4.0 May 8, 2024
@lhotari lhotari modified the milestones: 4.0.0, 4.1.0 Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs Stale
Projects
None yet
4 participants