-
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
[improve][broker] Make get list from bundle Admin API async #20652
[improve][broker] Make get list from bundle Admin API async #20652
Conversation
} | ||
asyncResponse.resume(topicList); | ||
} catch (Exception e) { | ||
log.error("[{}] Failed to list topics on namespace bundle {}/{}", clientAppId(), |
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 can remove try/catch
block
.host(webUrl.get().getHost()) | ||
.port(webUrl.get().getPort()) | ||
.replaceQueryParam("authoritative", newAuthoritative); | ||
if (!ExtensibleLoadManagerImpl.isLoadManagerExtensionEnabled(config())) { |
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.
Do we need to add this condition? And I'm not sure why need to reset the query param "destinationBroker".
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.
Yes, for the extensible load manager, the transfer operation needs to use destinationBroker
as the destination broker.
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.
Got it, thanks. Before, the param destinationBroker
was only used by the bundle unload command, so it's a little confusing.
The bundle unload command with the param destinationBroker
can't work with the extensible load manager, right?
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.
Before, the destinationBroker
is set in the leader broker's ModularLoadManagerImpl#bundleBrokerAffinityMap
, so it requires redirecting to the leader and setting the destinationBroker
before doing in the real unload operation.
The unload operation requires execution in the owner broker, which will redirect to the owner broker after setting the destinationBroker
success. If we don't clean the destinationBroker
parameter, it will fall into a loop.
The ExtensibleLoadManagerImpl
used a different way to transfer the ownership to destinationBroker
, so we do not need to clean the destinationBroker
parameter when redirecting. Since the destinationBroker
do not set in the leader broker.
For the detail, you can check this method: https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java#L954
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.
nit: ppl will appreciate it if you can add these details as 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.
Got it, thanks.
c3fa77c
to
45aa66a
Compare
Codecov Report
@@ Coverage Diff @@
## master #20652 +/- ##
============================================
+ Coverage 72.60% 73.17% +0.57%
- Complexity 32018 32068 +50
============================================
Files 1855 1867 +12
Lines 138569 138760 +191
Branches 15250 15264 +14
============================================
+ Hits 100605 101537 +932
+ Misses 29945 29185 -760
- Partials 8019 8038 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
|
(cherry picked from commit 4958f45)
Motivation
See: #14365, and fix when using
ExtensibleLoadManagerImpl
andvalidateNamespaceBundleOwnershipAsync
methods. It should redirect to the owner broker.Modifications
Make
NonPersistentTopics#getListFromBundle
to pure async.Documentation
doc
doc-required
doc-not-needed
doc-complete