You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/06 08:10:05 UTC
[GitHub] [pulsar] nicoloboschi opened a new pull request, #15040: [branch-2.8] Fix delete namespace issue (revert and fix #14619)
nicoloboschi opened a new pull request, #15040:
URL: https://github.com/apache/pulsar/pull/15040
### Motivation
The pull https://github.com/apache/pulsar/pull/14619 causes deadlock while deleting namespace.
The issue is 100% reproducible locally in the branch-2.8 if you run tests like
* `ProxyAuthorizationTest`
* `AdminApiTest#testCreateAndDeleteNamespaceWithBundles`
The issue is how the completableFuture instances are chained. The original pull uses async methods to cleanup the ZK resources instead the porting (https://github.com/apache/pulsar/pull/14619). This causes deadlock on the `metadata-store` thread-pooll
### Modifications
* Revert https://github.com/apache/pulsar/pull/14619
* Use async methods to cleanup the ZK resources
An alternative could be to port the refactoring of the ZK cleanup with https://github.com/apache/pulsar/pull/11791 and https://github.com/apache/pulsar/pull/12711 but it's a more complicated solution (the cherry-picks don't apply cleanly)
- [x] `no-need-doc`
--
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
[GitHub] [pulsar] eolivelli commented on pull request #15040: [branch-2.8] Fix delete namespace issue (revert and fix #14619)
Posted by GitBox <gi...@apache.org>.
eolivelli commented on PR #15040:
URL: https://github.com/apache/pulsar/pull/15040#issuecomment-1094293569
/pulsarbot run-failure-checks
--
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
[GitHub] [pulsar] Technoboy- commented on a diff in pull request #15040: [branch-2.8] Fix delete namespace issue (revert and fix #14619)
Posted by GitBox <gi...@apache.org>.
Technoboy- commented on code in PR #15040:
URL: https://github.com/apache/pulsar/pull/15040#discussion_r843867753
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:
##########
@@ -284,59 +284,45 @@ protected void internalDeleteNamespace(AsyncResponse asyncResponse, boolean auth
}
FutureUtil.waitForAll(futures).thenCompose(__ -> {
List<CompletableFuture<Void>> deleteBundleFutures = Lists.newArrayList();
- return pulsar().getNamespaceService().getNamespaceBundleFactory()
- .getBundlesAsync(namespaceName).thenCompose(bundles -> {
- for (NamespaceBundle bundle : bundles.getBundles()) {
- // check if the bundle is owned by any broker, if not then we do not need to delete
- // the bundle
- deleteBundleFutures.add(pulsar().getNamespaceService().getOwnerAsync(bundle)
- .thenCompose(ownership -> {
- if (ownership.isPresent()) {
- try {
- return pulsar().getAdminClient().namespaces()
- .deleteNamespaceBundleAsync(namespaceName.toString(),
- bundle.getBundleRange());
- } catch (PulsarServerException e) {
- throw new RestException(e);
- }
- } else {
- return CompletableFuture.completedFuture(null);
- }
- }));
- }
- return FutureUtil.waitForAll(deleteBundleFutures);
- });
- })
- .handle((result, exception) -> {
- if (exception != null) {
- if (exception.getCause() instanceof PulsarAdminException) {
- asyncResponse.resume(new RestException((PulsarAdminException) exception.getCause()));
- return null;
- } else {
- log.error("[{}] Failed to remove owned namespace {}", clientAppId(), namespaceName, exception);
- asyncResponse.resume(new RestException(exception.getCause()));
- return null;
- }
- }
-
+ NamespaceBundles bundles = null;
try {
- // we have successfully removed all the ownership for the namespace, the policies znode can be deleted
- // now
- final String globalZkPolicyPath = path(POLICIES, namespaceName.toString());
- final String localZkPolicyPath = joinPath(LOCAL_POLICIES_ROOT, namespaceName.toString());
- namespaceResources().delete(globalZkPolicyPath);
- try {
- getLocalPolicies().delete(localZkPolicyPath);
- } catch (NotFoundException nne) {
- // If the z-node with the modified information is not there anymore, we're already good
- }
+ bundles = pulsar().getNamespaceService().getNamespaceBundleFactory()
+ .getBundles(namespaceName);
Review Comment:
Why change this to sync ? I mean `getBundles`, not `getBundlesAsync`?
--
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
[GitHub] [pulsar] codelipenghui commented on pull request #15040: [branch-2.8] Fix delete namespace issue (revert and fix #14619)
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on PR #15040:
URL: https://github.com/apache/pulsar/pull/15040#issuecomment-1094169057
/pulsarbot run-failure-checks
--
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
[GitHub] [pulsar] nicoloboschi commented on pull request #15040: [branch-2.8] Fix delete namespace issue (revert and fix #14619)
Posted by GitBox <gi...@apache.org>.
nicoloboschi commented on PR #15040:
URL: https://github.com/apache/pulsar/pull/15040#issuecomment-1094648648
Checks:
* License -> https://github.com/apache/pulsar/pull/15044
* Client Api tests ->
> Error: Failures:
Error: org.apache.pulsar.client.api.MemoryLimitTest.testRejectMessages(org.apache.pulsar.client.api.MemoryLimitTest)
[INFO] Run 1: PASS
Error: Run 2: MemoryLimitTest.testRejectMessages:90 ยป ConditionTimeout Condition with lambda...
https://github.com/apache/pulsar/pull/14628
* Sql: I don't know but it failed in the latest 2.8 post-commit check: https://github.com/apache/pulsar/runs/5887254154?check_suite_focus=true
So I think we could merge this pull
--
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
[GitHub] [pulsar] nicoloboschi commented on pull request #15040: [branch-2.8] Fix delete namespace issue (revert and fix #14619)
Posted by GitBox <gi...@apache.org>.
nicoloboschi commented on PR #15040:
URL: https://github.com/apache/pulsar/pull/15040#issuecomment-1089977807
@Technoboy- PTAL
--
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
[GitHub] [pulsar] nicoloboschi commented on pull request #15040: [branch-2.8] Fix delete namespace issue (revert and fix #14619)
Posted by GitBox <gi...@apache.org>.
nicoloboschi commented on PR #15040:
URL: https://github.com/apache/pulsar/pull/15040#issuecomment-1090468952
/pulsarbot rerun-failure-checks
--
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
[GitHub] [pulsar] codelipenghui merged pull request #15040: [branch-2.8] Fix delete namespace issue (revert and fix #14619)
Posted by GitBox <gi...@apache.org>.
codelipenghui merged PR #15040:
URL: https://github.com/apache/pulsar/pull/15040
--
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