-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix:remove the loadbalance/bundle-data node #13164
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:remove the loadbalance/bundle-data node #13164
Conversation
|
@leizhiyuan:Thanks for your contribution. For this PR, do we need to update docs? |
|
@leizhiyuan:Thanks for providing doc info! |
315157973
left a comment
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.
LGTM
wolfstudy
left a comment
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.
Can you add test case for testDeleteTenant?
|
|
||
| // clear resource of `/loadbalance/bundle-data/{tenant}/` for zk-node | ||
| public CompletableFuture<Void> deleteBundleDataTenantAsync(String tenant) { | ||
| final String namespaceBundlePath = joinPath(BUNDLE_DATA_BASE_PATH, tenant); |
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.
Maybe tenantBundlePath is good name then namespaceBundlePath
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.
ok
| final String namespaceBundlePath = joinPath(BUNDLE_DATA_BASE_PATH, tenant); | ||
| CompletableFuture<Void> future = new CompletableFuture<Void>(); | ||
| deleteRecursiveAsync(this, namespaceBundlePath).whenComplete((ignore, ex) -> { | ||
| if (ex != null && ex.getCause() instanceof KeeperException.NoNodeException) { |
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.
If you use ex.getCause(), you get should not be a KeeperException, but an exception of the megastore that encapsulates the zk client. So here should use ex.getCause().getCause()?
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.
fixed
| final String namespaceBundlePath = joinPath(BUNDLE_DATA_BASE_PATH, ns.toString()); | ||
| CompletableFuture<Void> future = new CompletableFuture<Void>(); | ||
| deleteRecursiveAsync(this, namespaceBundlePath).whenComplete((ignore, ex) -> { | ||
| if (ex != null && ex.getCause() instanceof KeeperException.NoNodeException) { |
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.
Please use ex.getCause().getCause()
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.
ex.getCause().getCause() will be null
|
need to rerun the test case,It is not related with this pr。 |
| final String namespaceBundlePath = joinPath(BUNDLE_DATA_BASE_PATH, ns.toString()); | ||
| CompletableFuture<Void> future = new CompletableFuture<Void>(); | ||
| deleteRecursiveAsync(this, namespaceBundlePath).whenComplete((ignore, ex) -> { | ||
| if (ex != null && ExceptionUtils.getRootCause(ex) instanceof KeeperException.NoNodeException) { |
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.
We should use org.apache.pulsar.metadata.api.MetadataStoreException.NotFoundException to replace KeeperException.NoNodeException. The underlying metadata store supports multi implementations now.
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.
done
wolfstudy
left a comment
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.
Good Patch, LGTM
Fixes apache#13162 ### Motivation fix: remove the loadbalance/bundle-data node, when deleting namespace. it will cause zk node leak, fix apache#13162 ### Modifications remove the bundle-data Recursively
Fixes #13162
Motivation
fix: remove the loadbalance/bundle-data node, when deleting namespace. it will cause zk node leak, fix #13162
Modifications
remove the bundle-data Recursively
Verifying this change
Extended integration test for recovery after broker failure
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
doc-required(If you need help on updating docs, create a doc issue)
no-need-doc(Please explain why)
doc(If this PR contains doc changes)