-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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]fix npe when invoke replaceBookie. #16239
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.../main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java
Outdated
Show resolved
Hide resolved
codelipenghui
added
release/2.10.2
release/2.9.4
type/bug
The PR fixed a bug or issue reported a bug
area/broker
labels
Jun 27, 2022
gaozhangmin
approved these changes
Jun 27, 2022
coderzc
approved these changes
Jun 27, 2022
Technoboy-
approved these changes
Jun 27, 2022
nodece
approved these changes
Jun 28, 2022
/pulsarbot run-failure-checks |
codelipenghui
pushed a commit
that referenced
this pull request
Jun 28, 2022
* fix npe when invoke replaceBookie. * fix npe when invoke replaceBookie. * fix npe when invoke replaceBookie. Co-authored-by: nicklixinyang <nicklixinyang@didiglobal.com> (cherry picked from commit 0eed842)
mattisonchao
pushed a commit
that referenced
this pull request
Jul 2, 2022
* fix npe when invoke replaceBookie. * fix npe when invoke replaceBookie. * fix npe when invoke replaceBookie. Co-authored-by: nicklixinyang <nicklixinyang@didiglobal.com> (cherry picked from commit 0eed842)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/broker
cherry-picked/branch-2.9
Archived: 2.9 is end of life
cherry-picked/branch-2.10
doc-not-needed
Your PR changes do not impact docs
release/2.9.4
release/2.10.2
type/bug
The PR fixed a bug or issue reported a bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Fix the npe when the
ISOLATION_BOOKIE_GROUPS
is""
or missed which will produce in follow two case and can be reproduce by the unit test in this PR also.The npe point
pulsar/pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java
Line 220 in eeb22ba
pulsar/pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java
Line 247 in eeb22ba
Case 1:
When we set
strictBookieAffinityEnabled = true
and if some namespaces not setbookieAffinityGroup
, and then those namespaces will be setISOLATION_BOOKIE_GROUPS
as""
by default, which will cause npe when invokereplaceBookie
.pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Line 1513 in eeb22ba
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Lines 1529 to 1534 in eeb22ba
Case 2:
When the
bookieAffinityGroup
is not null and theISOLATION_BOOKIE_GROUPS
is null or "" also cause npeModifications
Describe the modifications you've done.
set a default value when
primaryIsolationGroupString
is empty.doc-not-needed