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 2021/08/26 07:55:48 UTC
[GitHub] [pulsar] gaozhangmin opened a new pull request #11791: Cleanup znode data when namespace deleted
gaozhangmin opened a new pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791
Fixes #11734
### Motivation
`/namespace/namespace-name` `/managed-ledger/namespace-name ` `/admin/partitioned-topic/namespace-name` znode remain unclean after namespace deleted`
### Modifications
delete these znode after namespace delete
### Does this pull request potentially affect one of the following parts:
*If `yes` was chosen, please highlight the changes*
- Dependencies (does it add or upgrade a dependency): (yes / no) no
- The public API: (yes / no) no
- The schema: (yes / no / don't know) no
- The default values of configurations: (yes / no)no
- The wire protocol: (yes / no)no
- The rest endpoints: (yes / no) no
- The admin cli options: (yes / no) no
- Anything that affects deployment: (yes / no / don't know)no
### Documentation
#### For contributor
For this PR, we need not to update docs, because it's not related to codes expose to users.
--
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] BewareMyPower merged pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
BewareMyPower merged pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791
--
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] gaozhangmin commented on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906865703
@BewareMyPower 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] gaozhangmin commented on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906946184
> Could you check the failed test first?
I fixed some failed tests, But some failed tests was passed on my own mac. I do not know why
--
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] gaozhangmin removed a comment on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin removed a comment on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906937758
--
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] BewareMyPower commented on a change in pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on a change in pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#discussion_r697218428
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
##########
@@ -306,11 +308,38 @@ protected void internalDeleteNamespace(AsyncResponse asyncResponse, boolean auth
}
try {
+ final String globalPartitionedPath = path(PARTITIONED_TOPIC_PATH_ZNODE, namespaceName.toString());
+ final String managedLedgerPath = joinPath(MANAGED_LEDGER_ROOT, namespaceName.toString());
+ // check whether partitioned topics znode exist
+ if (namespaceResources().exists(globalPartitionedPath)) {
+ deleteRecursive(namespaceResources(), globalPartitionedPath);
+ }
+
+ try {
+ if (namespaceResources().exists(managedLedgerPath)) {
+ pulsar().getPulsarResources().getTopicResources()
+ .clearDomainPersistence(namespaceName).get();
+ pulsar().getPulsarResources().getTopicResources()
+ .clearNamespacePersistence(namespaceName).get();
+ }
+ } catch (ExecutionException | InterruptedException e) {
+ // warn level log here since this failure has no side effect besides left a un-used metadata
Review comment:
Sounds reasonable. Mark it as resolved.
--
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] gaozhangmin commented on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906968298
/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] gaozhangmin closed pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin closed pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791
--
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] gaozhangmin commented on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906937758
/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] gaozhangmin commented on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906952009
/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] gaozhangmin removed a comment on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin removed a comment on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906968298
/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] gaozhangmin commented on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906969460
/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] eolivelli commented on a change in pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#discussion_r697158836
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
##########
@@ -306,11 +308,38 @@ protected void internalDeleteNamespace(AsyncResponse asyncResponse, boolean auth
}
try {
+ final String globalPartitionedPath = path(PARTITIONED_TOPIC_PATH_ZNODE, namespaceName.toString());
+ final String managedLedgerPath = joinPath(MANAGED_LEDGER_ROOT, namespaceName.toString());
+ // check whether partitioned topics znode exist
+ if (namespaceResources().exists(globalPartitionedPath)) {
+ deleteRecursive(namespaceResources(), globalPartitionedPath);
+ }
+
+ try {
+ if (namespaceResources().exists(managedLedgerPath)) {
+ pulsar().getPulsarResources().getTopicResources()
+ .clearDomainPersistence(namespaceName).get();
+ pulsar().getPulsarResources().getTopicResources()
+ .clearNamespacePersistence(namespaceName).get();
+ }
+ } catch (ExecutionException | InterruptedException e) {
+ // warn level log here since this failure has no side effect besides left a un-used metadata
Review comment:
The case of InterruptedException is to be handled by setting again Threwad.currentThread.interrupt()
I believe we have some utility method for this
--
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] BewareMyPower commented on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906880271
Could you check the failed test first?
--
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] gaozhangmin removed a comment on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin removed a comment on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906969460
/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] BewareMyPower commented on a change in pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on a change in pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#discussion_r697206324
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
##########
@@ -306,11 +308,38 @@ protected void internalDeleteNamespace(AsyncResponse asyncResponse, boolean auth
}
try {
+ final String globalPartitionedPath = path(PARTITIONED_TOPIC_PATH_ZNODE, namespaceName.toString());
+ final String managedLedgerPath = joinPath(MANAGED_LEDGER_ROOT, namespaceName.toString());
+ // check whether partitioned topics znode exist
+ if (namespaceResources().exists(globalPartitionedPath)) {
+ deleteRecursive(namespaceResources(), globalPartitionedPath);
+ }
+
+ try {
+ if (namespaceResources().exists(managedLedgerPath)) {
+ pulsar().getPulsarResources().getTopicResources()
+ .clearDomainPersistence(namespaceName).get();
+ pulsar().getPulsarResources().getTopicResources()
+ .clearNamespacePersistence(namespaceName).get();
+ }
+ } catch (ExecutionException | InterruptedException e) {
+ // warn level log here since this failure has no side effect besides left a un-used metadata
Review comment:
@eolivelli I'm afraid we don't have utility method for `InterruptedException` now. I think we should throw `RestException` here if `e` is `InterruptedException` like https://github.com/apache/pulsar/blob/6aa44a0e7cfed161da8db35e6b50c9f3a595629e/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java#L684-L686
But I also found in this method, the `InterruptedException` was just swallowed and only warn logs are printed. See https://github.com/apache/pulsar/blob/6aa44a0e7cfed161da8db35e6b50c9f3a595629e/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java#L494-L498
I prefer the first way to handle `InterruptedException`, what's your opinion?
--
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] gaozhangmin commented on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-907024942
> Could you check the failed test first?
All checks ars passed.
--
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 a change in pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#discussion_r697213644
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
##########
@@ -306,11 +308,38 @@ protected void internalDeleteNamespace(AsyncResponse asyncResponse, boolean auth
}
try {
+ final String globalPartitionedPath = path(PARTITIONED_TOPIC_PATH_ZNODE, namespaceName.toString());
+ final String managedLedgerPath = joinPath(MANAGED_LEDGER_ROOT, namespaceName.toString());
+ // check whether partitioned topics znode exist
+ if (namespaceResources().exists(globalPartitionedPath)) {
+ deleteRecursive(namespaceResources(), globalPartitionedPath);
+ }
+
+ try {
+ if (namespaceResources().exists(managedLedgerPath)) {
+ pulsar().getPulsarResources().getTopicResources()
+ .clearDomainPersistence(namespaceName).get();
+ pulsar().getPulsarResources().getTopicResources()
+ .clearNamespacePersistence(namespaceName).get();
+ }
+ } catch (ExecutionException | InterruptedException e) {
+ // warn level log here since this failure has no side effect besides left a un-used metadata
Review comment:
in this case it is better to continue the operation.
logging is fine to me in this case, this is an API request execution and InterruptedException means to exist as soon as possible,
here it is better to complete the operation
--
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] gaozhangmin commented on pull request #11791: Cleanup znode data when namespace deleted
Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on pull request #11791:
URL: https://github.com/apache/pulsar/pull/11791#issuecomment-906984836
/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