-
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][bookie] Correctly handle list configuration values #17661
Merged
michaeljmarshall
merged 2 commits into
apache:master
from
michaeljmarshall:fix-comma-delimited-list-for-rack-awareness
Oct 11, 2022
Merged
[fix][bookie] Correctly handle list configuration values #17661
michaeljmarshall
merged 2 commits into
apache:master
from
michaeljmarshall:fix-comma-delimited-list-for-rack-awareness
Oct 11, 2022
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
michaeljmarshall
added
type/bug
The PR fixed a bug or issue reported a bug
component/bookkeeper
doc-not-needed
Your PR changes do not impact docs
labels
Sep 15, 2022
michaeljmarshall
requested review from
lhotari,
gaozhangmin,
eolivelli,
murong00 and
liudezhi2098
September 15, 2022 04:36
@lhotari @eolivelli - PTAL, thanks! |
eolivelli
approved these changes
Oct 11, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect
michaeljmarshall
deleted the
fix-comma-delimited-list-for-rack-awareness
branch
October 11, 2022 20:19
michaeljmarshall
added a commit
that referenced
this pull request
Oct 11, 2022
* [fix][bookie] Correctly handle list configuration values * Remove unused import ### Motivation When the `metadataServiceUri` or the `zkServers` configuration for `BookieRackAffinityMapping` is provided as a comma delimited list, it is automatically parsed into an ArrayList by the configuration class because the Bookkeeper configuration class relies on the defaults in the `org.apache.commons.configuration.AbstractConfiguration` class. Here is a sample error: ``` 2022-07-29T19:25:43,437+0000 [main] ERROR org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl - Failed to initialize DNS Resolver org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping, used default subnet resolver java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap') ``` Also, see #6349 and #6343 for context. ### Modifications * Move the `castToString` method out to a shared class. * Use the `castToString` method to safely get the configuration value. ### Verifying this change This PR includes a test. ### Documentation - [x] `doc-not-needed` (cherry picked from commit 69deb1f)
michaeljmarshall
added a commit
that referenced
this pull request
Oct 11, 2022
* [fix][bookie] Correctly handle list configuration values * Remove unused import ### Motivation When the `metadataServiceUri` or the `zkServers` configuration for `BookieRackAffinityMapping` is provided as a comma delimited list, it is automatically parsed into an ArrayList by the configuration class because the Bookkeeper configuration class relies on the defaults in the `org.apache.commons.configuration.AbstractConfiguration` class. Here is a sample error: ``` 2022-07-29T19:25:43,437+0000 [main] ERROR org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl - Failed to initialize DNS Resolver org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping, used default subnet resolver java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap') ``` Also, see #6349 and #6343 for context. ### Modifications * Move the `castToString` method out to a shared class. * Use the `castToString` method to safely get the configuration value. ### Verifying this change This PR includes a test. ### Documentation - [x] `doc-not-needed` (cherry picked from commit 69deb1f)
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
Oct 12, 2022
* [fix][bookie] Correctly handle list configuration values * Remove unused import ### Motivation When the `metadataServiceUri` or the `zkServers` configuration for `BookieRackAffinityMapping` is provided as a comma delimited list, it is automatically parsed into an ArrayList by the configuration class because the Bookkeeper configuration class relies on the defaults in the `org.apache.commons.configuration.AbstractConfiguration` class. Here is a sample error: ``` 2022-07-29T19:25:43,437+0000 [main] ERROR org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl - Failed to initialize DNS Resolver org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping, used default subnet resolver java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.lang.String (java.util.ArrayList and java.lang.String are in module java.base of loader 'bootstrap') ``` Also, see apache#6349 and apache#6343 for context. ### Modifications * Move the `castToString` method out to a shared class. * Use the `castToString` method to safely get the configuration value. ### Verifying this change This PR includes a test. ### Documentation - [x] `doc-not-needed` (cherry picked from commit 69deb1f) (cherry picked from commit 9759815)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-picked/branch-2.10
cherry-picked/branch-2.11
doc-not-needed
Your PR changes do not impact docs
release/2.10.3
release/2.11.1
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
When the
metadataServiceUri
or thezkServers
configuration forBookieRackAffinityMapping
is provided as a comma delimited list, it is automatically parsed into an ArrayList by the configuration class because the Bookkeeper configuration class relies on the defaults in theorg.apache.commons.configuration.AbstractConfiguration
class. Here is a sample error:Also, see #6349 and #6343 for context.
Modifications
castToString
method out to a shared class.castToString
method to safely get the configuration value.Verifying this change
This PR includes a test.
Documentation
doc-not-needed