-
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] Ignore the exception of creating namespace #18837
Conversation
try { | ||
broker.getAdminClient().namespaces().createNamespace(ns.toString()); | ||
} catch (Exception e) { | ||
log.warn(e.getMessage()); |
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.
log.warn(e.getMessage()); | |
log.warn("...", e); |
Besides, if the default manner to start a standalone cluster falls back to this branch, how can a standalone cluster successfully create the namespace (with what extra configs)?
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.
When the authentication/authorization is enabled, we should configure the brokerClientAuthenticationPlugin
and brokerClientAuthenticationParameters
.
To avoid breaking change, so I made this PR.
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.
The namespace could be created via pulsar-admin
with correct authentication info later. See how the C++ client's unit tests set up the test env. https://github.com/apache/pulsar-client-cpp/blob/2018a06e8afcde4de59971cfbc5f653a4f9d7897/build-support/start-test-service-inside-container.sh#L59-L63
Cross-reference to #18755. |
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.
Could you add an integration test to avoid the regression?
Signed-off-by: Zixuan Liu <[email protected]>
Signed-off-by: Zixuan Liu <[email protected]>
60b3f2c
to
410ca5f
Compare
Codecov Report
@@ Coverage Diff @@
## master #18837 +/- ##
============================================
- Coverage 46.17% 37.38% -8.80%
+ Complexity 10359 5076 -5283
============================================
Files 703 414 -289
Lines 68845 44670 -24175
Branches 7382 4573 -2809
============================================
- Hits 31788 16699 -15089
+ Misses 33448 25735 -7713
+ Partials 3609 2236 -1373
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Zixuan Liu <[email protected]>
### Motivation apache#17864 and apache#18837 tried to fix the regression of the namespace bundle policy in standalone by creating the namespace via `PulsarAdmin`. It brings a problem that the namespace would not be created successfully if the authentication of the built-in admin client was not configured. It brings the regression that makes the set up of the C++ client's unit tests in branch-2.11 fail. Because the steps are: - Start a standalone - Update the policy of `public/default` via `pulsar-admin` without creating the namespace ### Modifications Do not use `PulsarAdmin` to create the namespace when starting the standalone. Instead, set the bundle policy according to the `defaultNumberOfNamespaceBundles` config. Add a `testStandaloneWithRocksDB` to test the namespace can still be created even if no broker client authentication is configured. Then move the bundle policy test from `SmokeTest` to this test.
### Motivation apache#15186 changed the behavior of how to create the default namespace. However, it brings a regression that even if the built-in admin didn't have the authentication configured while the standalone enabled the authentication, the namespace could still be created successfully. This PR also changed the deploy script to remove the creation of "public/default" namespace. Instead, it grants the permission to this namespace directly. After apache#17864 and apache#18837, the namespace will be created by the built-in admin again. But the deploy script would fail. ### Modifications Create the default namespace via `pulsar-admin` in the deploy script.
Motivation
In the standalone model, when the
admin
client hasn't permission to create the namespace, the Pulsar will exit.We should keep the same logic with branch-2.10.
https://github.com/apache/pulsar/blob/branch-2.10/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java#L409-L414
Modifications
Add
try...catch
to pack.Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: