pulsarctl icon indicating copy to clipboard operation
pulsarctl copied to clipboard

[Discuss] pulsarctl should use "--non-partitioned" instead of "partitioned" for topic as default type

Open candlerb opened this issue 5 years ago • 8 comments

pulsarctl won't delete a normal topic unless given --non-partioned flag:

$ ./pulsarctl topic delete persistent://public/default/temp
[✖]  code: 404 reason: Partitioned topic does not exist
$ ./pulsarctl topic delete --non-partitioned persistent://public/default/temp
Delete topic persistent://public/default/temp successfully

However, pulsar-admin does not need to be told this.

$ apache-pulsar-2.4.1/bin/pulsar-admin topics delete persistent://public/default/temp
$ 

candlerb avatar Nov 14 '19 11:11 candlerb

Hi @candlerb .

In pulsar-admin, there are two commands to delete topics. bin/pulsar-admin delete-partitioned-topic is used to delete partitioned topic and bin/pulsar-admin delete is used to delete non-partitioned-topic.

I integrate them in Pulsarctl as one command, so you need to specify the topic type to delete it.

Thanks.

zymap avatar Nov 14 '19 11:11 zymap

pulsar-admin chooses the shorter command for normal (non-partitioned) topics.

Perhaps pulsarctl could make this the default and have a --partitioned flag instead?

candlerb avatar Nov 14 '19 11:11 candlerb

@candlerb Thank you for your advice. Do you want to send out a pull request to propose a change?

zymap avatar Nov 19 '19 03:11 zymap

Probably no time. Likely switching to Kafka.

candlerb avatar Nov 19 '19 10:11 candlerb

As discussed above, This is a request to replace the default type for topic delete from partitioned to non-partioned. In Pulsar usage, partitioned topic is used more often, would like to keep this behavior. Would like to close this issue.

jiazhai avatar Dec 09 '19 12:12 jiazhai

In Pulsar usage, partitioned topic is used more often, would like to keep this behavior.

  1. Perhaps that's true for your usage, but I don't think it applies in general.

    One of the main plus points of Pulsar over Kafka is that it doesn't require topics to be partitioned, even to share load amongst consumers in a group. You only need to partition for very high throughput, when the broker itself becomes the bottleneck.

  2. The behaviour of pulsar-admin is to work with non-partitioned topics by default. In my opinion, it adds confusion if pulsarctl behaves differently to pulsar-admin.

The documentation says:

Partitioned topics are a special type of topic

(my emphasis: implies they are not the normal case)

Partitioned topics need to be explicitly created via the admin API.

(whereas normal topics are created dynamically on demand, which is what the example use cases show)

candlerb avatar Dec 09 '19 13:12 candlerb

@candlerb

One of the main plus points of Pulsar over Kafka is that it doesn't require topics to be partitioned, even to share load amongst consumers in a group.

I agree with you, pulsar support non-partitioned topic.

You only need to partition for very high throughput.

Normally, it is hard to do a predicate for the future throughput of topic at the create time. So a default partitioned topic would avoid the switch, which is not supported yet, in the future once it require the high throughput.

If you don't agree to close this. we could let it open. and If more user want to use non-partioned topic as default, they could +1 for this issue.

jiazhai avatar Dec 11 '19 04:12 jiazhai

also change the issue title to make it clear.

jiazhai avatar Dec 11 '19 04:12 jiazhai