You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "gaoran10 (via GitHub)" <gi...@apache.org> on 2023/06/27 04:05:49 UTC
[GitHub] [pulsar] gaoran10 commented on a diff in pull request #20652: [improve][broker] Make get list from bundle Admin API async
gaoran10 commented on code in PR #20652:
URL: https://github.com/apache/pulsar/pull/20652#discussion_r1243115492
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:
##########
@@ -717,19 +717,19 @@ public CompletableFuture<Void> validateBundleOwnershipAsync(NamespaceBundle bund
throw new RestException(Status.PRECONDITION_FAILED,
"Failed to find ownership for ServiceUnit:" + bundle.toString());
}
- // If the load manager is extensible load manager, we don't need check the authoritative.
- if (ExtensibleLoadManagerImpl.isLoadManagerExtensionEnabled(config())) {
- return CompletableFuture.completedFuture(null);
- }
return nsService.isServiceUnitOwnedAsync(bundle)
.thenAccept(owned -> {
if (!owned) {
boolean newAuthoritative = this.isLeaderBroker();
// Replace the host and port of the current request and redirect
- URI redirect = UriBuilder.fromUri(uri.getRequestUri()).host(webUrl.get().getHost())
- .port(webUrl.get().getPort()).replaceQueryParam("authoritative",
- newAuthoritative).replaceQueryParam("destinationBroker",
- null).build();
+ UriBuilder uriBuilder = UriBuilder.fromUri(uri.getRequestUri())
+ .host(webUrl.get().getHost())
+ .port(webUrl.get().getPort())
+ .replaceQueryParam("authoritative", newAuthoritative);
+ if (!ExtensibleLoadManagerImpl.isLoadManagerExtensionEnabled(config())) {
Review Comment:
Do we need to add this condition?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org