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][broker] Return getOwnerAsync without waiting on source broker upon Assigning and Releasing and handle role change during role init #22112

Merged
merged 4 commits into from
Feb 28, 2024

Conversation

heesung-sn
Copy link
Contributor

@heesung-sn heesung-sn commented Feb 24, 2024

Motivation

Upon Assigning and Releasing, if this broker is not the dst broker, return the dst broker as the owner(or empty). Clients need to connect(redirect) to the dst broker anyway and wait for the dst broker to receive Owned. This is also required to return getOwnerAsync on the src broker immediately during unloading. Otherwise, topic creation(getOwnerAsync) could block unloading bundles, if the topic creation(getOwnerAsync) happens during unloading on the src broker.

Found a case that the broker role might change in the middle while running playLeader or playFollower. In this case, we need to break the init loop and restart playLeader or playFollower according to the current role.

Modifications

  • Return getOwnerAsync without waiting on source broker upon Assigning and Releasing
  • Updated role change logic in case the role changes again while initializing the current role.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests.

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: heesung-sn#63

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 24, 2024
@heesung-sn heesung-sn self-assigned this Feb 24, 2024
@Technoboy- Technoboy- added this to the 3.3.0 milestone Feb 24, 2024
@Technoboy- Technoboy- closed this Feb 24, 2024
@Technoboy- Technoboy- reopened this Feb 24, 2024
@heesung-sn heesung-sn changed the title [fix][broker] Return getOwnerAsync without waiting on source broker upon Assigning and Releasing [fix][broker] Return getOwnerAsync without waiting on source broker upon Assigning and Releasing and handle role change during role init Feb 27, 2024
@heesung-sn heesung-sn merged commit 56eb758 into apache:master Feb 28, 2024
56 of 57 checks passed
heesung-sn added a commit to heesung-sn/pulsar that referenced this pull request Feb 29, 2024
…pon Assigning and Releasing and handle role change during role init (apache#22112)

(cherry picked from commit 56eb758)
heesung-sn added a commit to heesung-sn/pulsar that referenced this pull request Feb 29, 2024
…pon Assigning and Releasing and handle role change during role init (apache#22112)

(cherry picked from commit 56eb758)
heesung-sn added a commit that referenced this pull request Feb 29, 2024
…rce broker upon Assigning and Releasing and handle role change during role init (#22112) (#22156)
heesung-sn added a commit that referenced this pull request Feb 29, 2024
…rce broker upon Assigning and Releasing and handle role change during role init (#22112) (#22156)

(cherry picked from commit b3b1bfb)
heesung-sn added a commit that referenced this pull request Feb 29, 2024
…pon Assigning and Releasing and handle role change during role init (#22112)

(cherry picked from commit 56eb758)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 1, 2024
…rce broker upon Assigning and Releasing and handle role change during role init (apache#22112) (apache#22156)

(cherry picked from commit b3b1bfb)
(cherry picked from commit 58a45aa)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 6, 2024
…rce broker upon Assigning and Releasing and handle role change during role init (apache#22112) (apache#22156)

(cherry picked from commit b3b1bfb)
(cherry picked from commit 58a45aa)
@heesung-sn heesung-sn deleted the update-getOwnerAsync branch April 2, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants