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/18 02:12:11 UTC

[GitHub] [pulsar] WillsonYip opened a new issue, #15193: Topic unload code in admin api is confusing

WillsonYip opened a new issue, #15193:
URL: https://github.com/apache/pulsar/issues/15193

   **Describe the bug**
   
   I look into the unload code in admin api . And I found the code a little bit not right. 
   
   PersistentTopicsBase class :  https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
   
   ```java
       protected void internalUnloadTopic(AsyncResponse asyncResponse, boolean authoritative) {
           log.info("[{}] Unloading topic {}", clientAppId(), topicName);
           CompletableFuture<Void> future;
           if (topicName.isGlobal()) {
               future = validateGlobalNamespaceOwnershipAsync(namespaceName);
           } else {
               future = CompletableFuture.completedFuture(null);
           }
          future.thenAccept(__ -> {
              // If the topic name is a partition name, no need to get partition topic metadata again
              if (topicName.isPartitioned()) {
                  if (checkTopicIsTransactionCoordinatorAssign(topicName)) {
                      internalUnloadTransactionCoordinatorAsync(asyncResponse, authoritative);
                  } else {
                      internalUnloadNonPartitionedTopicAsync(asyncResponse, authoritative);
                  }
              } else {
   
   ```
   
   when `topicName.isPartitioned()`  is true ,  but  call  `internalUnloadNonPartitionedTopicAsync` method , which is inconsistent with the name . 
   
   I am not sure how it influence the api result .  It just look odd
   
   
   
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] Technoboy- closed issue #15193: Topic unload code in admin api is confusing

Posted by GitBox <gi...@apache.org>.
Technoboy- closed issue #15193: Topic unload code in admin api is  confusing
URL: https://github.com/apache/pulsar/issues/15193


-- 
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 issue #15193: Topic unload code in admin api is confusing

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on issue #15193:
URL: https://github.com/apache/pulsar/issues/15193#issuecomment-1101957590

   `topicName.isPartitioned()` means topicName contains partition, could not have any partition anymore, so also means non-partitioned.


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