AnonHxy commented on code in PR #17797:
URL: https://github.com/apache/pulsar/pull/17797#discussion_r990740842
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:
##########
@@ -880,12 +881,22 @@ void splitAndOwnBundleOnceAndRetry(NamespaceBundle bundle,
for (NamespaceBundle sBundle :
splittedBundles.getRight()) {
Objects.requireNonNull(ownershipCache.tryAcquiringOwnership(sBundle));
}
- updateNamespaceBundles(nsname,
splittedBundles.getLeft())
- .thenRun(() -> {
-
bundleFactory.invalidateBundleCache(bundle.getNamespaceObject());
-
updateFuture.complete(splittedBundles.getRight());
- }).exceptionally(ex1 -> {
- String msg = format("failed to update
namespace policies [%s], "
+ updateNamespaceBundles(nsname,
splittedBundles.getLeft()).thenRun(() -> {
+
updateNamespaceBundlesForPolicies(nsname, splittedBundles.getLeft())
+ .thenRun(() -> {
+
bundleFactory.invalidateBundleCache(bundle.getNamespaceObject());
+
updateFuture.complete(splittedBundles.getRight());
+ }).exceptionally(e -> {
+ String msg =
format("failed to update namespace policies [%s], "
+ +
"NamespaceBundle: %s due to %s",
+ nsname.toString(),
bundle.getBundleRange(), e.getMessage());
+ LOG.warn(msg);
+
updateFuture.completeExceptionally(
+ new
ServiceUnitNotReadyException(msg, e.getCause()));
+ return null;
+ });
Review Comment:
Is it possible to remove line889 to line897?It seems same with line898 to
line905
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]