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/08/10 05:41:38 UTC

[GitHub] [pulsar] Technoboy- opened a new pull request, #17033: [improve][admin] Unset namespace policy to improve deleting namespace.

Technoboy- opened a new pull request, #17033:
URL: https://github.com/apache/pulsar/pull/17033

   ### Motivation
   
   When there are many partitioned topics under a namespace, deleting the namespace forcibly will fail, because many requests update ns policies simultaneously and cause the metadata store throws BadVersionException.
   
   See `internalRemovePartitionsAuthenticationPoliciesAsync`
   https://github.com/apache/pulsar/blob/374b3a18155cba33c4b4cfdb18c8119487be565e/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java#L612-L629
   
   https://github.com/apache/pulsar/blob/374b3a18155cba33c4b4cfdb18c8119487be565e/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java#L704-L714
   
   When deleting the namespace, there is no need to update namespace policies, we can delete the namespace zk node in the end. 
   https://github.com/apache/pulsar/blob/374b3a18155cba33c4b4cfdb18c8119487be565e/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java#L363-L381
   
   
   ### Documentation
   
   - [x] `doc-not-needed` 
   (Please explain 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] Technoboy- merged pull request #17033: [improve][admin] Unset namespace policy to improve deleting namespace.

Posted by GitBox <gi...@apache.org>.
Technoboy- merged PR #17033:
URL: https://github.com/apache/pulsar/pull/17033


-- 
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 #17033: [improve][admin] Unset namespace policy to improve deleting namespace.

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on code in PR #17033:
URL: https://github.com/apache/pulsar/pull/17033#discussion_r945030642


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:
##########
@@ -478,16 +478,13 @@ protected void internalDeleteNamespaceForcefully(AsyncResponse asyncResponse, bo
                         if (topicName.isPartitioned()) {
                             String partitionedTopic = topicName.getPartitionedTopicName();
                             if (!partitionedTopics.contains(partitionedTopic)) {
-                                // Distinguish partitioned topic to avoid duplicate deletion of the same schema
-                                topicFutures.add(pulsar().getAdminClient().topics().deletePartitionedTopicAsync(
-                                        partitionedTopic, true, true));
                                 partitionedTopics.add(partitionedTopic);
                             }
                         } else {
-                            topicFutures.add(pulsar().getAdminClient().topics().deleteAsync(
-                                    topic, true, true));
                             nonPartitionedTopics.add(topic);
                         }
+                        topicFutures.add(pulsar().getAdminClient().topics().deleteAsync(

Review Comment:
   fixed 



-- 
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] gaoran10 commented on a diff in pull request #17033: [improve][admin] Unset namespace policy to improve deleting namespace.

Posted by GitBox <gi...@apache.org>.
gaoran10 commented on code in PR #17033:
URL: https://github.com/apache/pulsar/pull/17033#discussion_r944272602


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:
##########
@@ -478,16 +478,13 @@ protected void internalDeleteNamespaceForcefully(AsyncResponse asyncResponse, bo
                         if (topicName.isPartitioned()) {
                             String partitionedTopic = topicName.getPartitionedTopicName();
                             if (!partitionedTopics.contains(partitionedTopic)) {
-                                // Distinguish partitioned topic to avoid duplicate deletion of the same schema
-                                topicFutures.add(pulsar().getAdminClient().topics().deletePartitionedTopicAsync(
-                                        partitionedTopic, true, true));
                                 partitionedTopics.add(partitionedTopic);
                             }
                         } else {
-                            topicFutures.add(pulsar().getAdminClient().topics().deleteAsync(
-                                    topic, true, true));
                             nonPartitionedTopics.add(topic);
                         }
+                        topicFutures.add(pulsar().getAdminClient().topics().deleteAsync(

Review Comment:
   Maybe we can use the method `topics().deleteAsync(topic, true)`, the method `topics().deleteAsync(topic, true, true)` is deprecated.



-- 
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] poorbarcode commented on a diff in pull request #17033: [improve][admin] Unset namespace policy to improve deleting namespace.

Posted by GitBox <gi...@apache.org>.
poorbarcode commented on code in PR #17033:
URL: https://github.com/apache/pulsar/pull/17033#discussion_r944466095


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:
##########
@@ -478,16 +478,13 @@ protected void internalDeleteNamespaceForcefully(AsyncResponse asyncResponse, bo
                         if (topicName.isPartitioned()) {
                             String partitionedTopic = topicName.getPartitionedTopicName();
                             if (!partitionedTopics.contains(partitionedTopic)) {
-                                // Distinguish partitioned topic to avoid duplicate deletion of the same schema
-                                topicFutures.add(pulsar().getAdminClient().topics().deletePartitionedTopicAsync(
-                                        partitionedTopic, true, true));
                                 partitionedTopics.add(partitionedTopic);
                             }
                         } else {
-                            topicFutures.add(pulsar().getAdminClient().topics().deleteAsync(
-                                    topic, true, true));
                             nonPartitionedTopics.add(topic);
                         }
+                        topicFutures.add(pulsar().getAdminClient().topics().deleteAsync(

Review Comment:
   +1 
   
   param "deleteSchema" of API `delete topic` has been removed in PR #14608.
   
   <img width="1014" alt="截屏2022-08-12 21 30 20" src="https://user-images.githubusercontent.com/25195800/184364237-71d0d154-0b1e-401e-9c9c-7aa958f4b04c.png">
   



-- 
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