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 2020/06/03 09:14:11 UTC

[GitHub] [pulsar] BewareMyPower opened a new issue #7152: Increase partitions of a non-existing topic created multiple non-partitioned topics

BewareMyPower opened a new issue #7152:
URL: https://github.com/apache/pulsar/issues/7152


   **Describe the bug**
   If I try to increase partitions of a non-existing topic, the method would fail but multiple non-partitioned topics would be created after that.
   
   **To Reproduce**
   Assume that we had a standalone Pulsar running. There're no topics at first:
   
   ```bash
   $ URL_BASE=http://localhost:8080/admin/v2/persistent/public/default
   $ curl $URL_BASE; echo
   []
   ```
   
   Here we use POST method to increase partitions, but the target topic `Foo` doesn't exist. Check topics again, we found there're 3 new topics:
   
   ```bash
   $ curl $URL_BASE/Foo/partitions -X POST -H 'Content-Type: application/json' -d "3"; echo
   {"reason":"Topic is not partitioned topic"}
   $ curl $URL_BASE; echo
   ["persistent://public/default/Foo-partition-0","persistent://public/default/Foo-partition-1","persistent://public/default/Foo-partition-2"]
   ```
   
   However, it can't be treated as a partitioned topic, so we can't use relative admin APIs to delete it, create a partitioned topic `Foo`, or increase partitions. The only way is to delete each single topic one by one:
   
   ```bash
   $ curl $URL_BASE/Foo/partitions -X DELETE; echo
   {"reason":"Partitioned topic does not exist"}
   $ curl $URL_BASE/Foo/partitions -X POST -H 'Content-Type: application/json' -d "5"; echo
   {"reason":"Already have non partition topicpersistent://public/default/Foo-partition-0 which contains partition suffix '-partition-' and end with numeric value and end with numeric value smaller than the new number of partition. Update of partitioned topic Foo could cause conflict."}
   $ curl $URL_BASE/Foo/partitions -X PUT -H 'Content-Type: application/json' -d "5"; echo
   {"reason":"This topic already exists"}
   $ curl $URL_BASE/Foo-partition-0 -X DELETE
   $ curl $URL_BASE/Foo-partition-1 -X DELETE
   $ curl $URL_BASE/Foo-partition-2 -X DELETE
   $ curl $URL_BASE; echo
   []
   ```
   
   **Expected behavior**
   When we try to increase partitions of a non-existing topic, no topics should be created. The POST method should affect nothing.


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

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



[GitHub] [pulsar] codelipenghui closed issue #7152: Increase partitions of a non-existing topic created multiple non-partitioned topics

Posted by GitBox <gi...@apache.org>.
codelipenghui closed issue #7152:
URL: https://github.com/apache/pulsar/issues/7152


   


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

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



[GitHub] [pulsar] aloyszhang commented on issue #7152: Increase partitions of a non-existing topic created multiple non-partitioned topics

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


   Some error with pulsar-admin APIs, It was caused by no validation about non-partitioned topic or partitoined topic before update the partition numbers. 
   We should add the validation before do the update.


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

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



[GitHub] [pulsar] aloyszhang edited a comment on issue #7152: Increase partitions of a non-existing topic created multiple non-partitioned topics

Posted by GitBox <gi...@apache.org>.
aloyszhang edited a comment on issue #7152:
URL: https://github.com/apache/pulsar/issues/7152#issuecomment-639255924


   Same error with pulsar-admin APIs, It was caused by no validation about non-partitioned topic or partitoined topic before update the partition numbers. 
   We should add the validation before do the update.


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

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