apache / apache/pulsar

[Bug] Didn't updata metadata when try to updata the num of partitions of a partitioned-topic

Open
#19,207 4 comments 0 reactions 0 assignees View on GitHub
Stale type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.

### Version

v-2.10.0

### Minimal reproduce step

1、We've got a partitioned-topic which had only one partition and it was behave normaly.
2、When I try to updata the num of partitions of that partitioned-topic from 1 to 30, if I don't use -f(means force to do that), got err msg like this
![image](https://user-images.githubusercontent.com/28603029/212059679-b04e3f9a-934e-44e5-8a41-e40d20fa9bf0.png)
But when I use -f in the same command, it showed nothing in command line.
![image](https://user-images.githubusercontent.com/28603029/212059847-c3f439f3-76d9-45e2-b60e-c8a90c8a56cc.png)
3、After I used the command(pulsar-admin topics update-partitioned-topic)to update num of partitions whih -f, seemed like it was succeed. And then I tried to use admin command(pulsar-admin topics list)to verify the rsult, accualy there was partition-0 to partition-29, seemed correct.
![image](https://user-images.githubusercontent.com/28603029/212058828-689c39c3-d63d-4524-8703-71af3361560c.png)
But when I used another command(pulsar-admin topics get-partitioned-topic-metadata)to get the true num of partitions from metadata, it was still 1……
![image](https://user-images.githubusercontent.com/28603029/212059537-2a3724e9-e111-488e-bd3e-c7b11abd1c48.png)
And then I double check this result in zookeeper, the num of partitions was truely 1.
![image](https://user-images.githubusercontent.com/28603029/212060210-d488223d-b765-4c9f-aed4-3ecdffb39cd6.png)

### What did you expect to see?

Succeed to update the num of partitions of the specific partitioned-topic, and updata to metadata correct.

### What did you see instead?

As above~

### Anything else?

I‘ve fix that problem in my pulsar clulster by delete the partitioned-topic and then recreate a partitioned-topic with the specific num of partitions which I want.
Looking forward to your guys reply~

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the update-partitioned-topic command with and without -f, then compare pulsar-admin topics list with get-partitioned-topic-metadata and the corresponding ZooKeeper value. Done means increasing a topic from one to 30 partitions updates the metadata consistently with the created partitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.