Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix create consumer on partitioned topic while disable topic auto creation. #5572

Merged
merged 6 commits into from
Jan 9, 2020

Conversation

codelipenghui
Copy link
Contributor

@codelipenghui codelipenghui commented Nov 6, 2019

Fixes #5565

Motivation

Currently, disable the topic auto creation will cause consumer create failed on a partitioned topic. Since the partitioned topic is already created, so we should handle the topic partition create when disable the topic auto creation.

Modifications

By default, create partitioned topics also try to create all partitions, and if create partitions failed, users can use create-missed-partitions to repair.

If users already have a partitioned topic without created partitions, can also use create-missed-partitions to repair.

Verifying this change

Add new unit tests for this change

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

@codelipenghui
Copy link
Contributor Author

@wolfstudy if this PR can complete before cut 2.4.2, please considering include it, thanks.

@wolfstudy wolfstudy added this to the 2.4.2 milestone Nov 6, 2019
Copy link
Member

@sijie sijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is the right fix for this problem. The purpose of disabling topic auto-creation is to prevent consumers and producers creating topics.

I think the correct fix should be improving the pulsar-admin tool to create and delete partitions when creating or updating a partitioned topic.

@wolfstudy wolfstudy added the type/bug The PR fixed a bug or issue reported a bug label Nov 6, 2019
@codelipenghui
Copy link
Contributor Author

run integration tests

@codelipenghui
Copy link
Contributor Author

run java8 tests

@wolfstudy
Copy link
Member

@codelipenghui l will change the Milestone to 2.4.3. So we can cut 2.4.2 and if needed
2.4.3 in a few weeks.

@wolfstudy wolfstudy modified the milestones: 2.4.2, 2.4.3 Nov 13, 2019
@codelipenghui
Copy link
Contributor Author

@wolfstudy Thanks

@codelipenghui
Copy link
Contributor Author

run java8 tests

1 similar comment
@codelipenghui
Copy link
Contributor Author

run java8 tests

@codelipenghui
Copy link
Contributor Author

run java8 tests

3 similar comments
@codelipenghui
Copy link
Contributor Author

run java8 tests

@codelipenghui
Copy link
Contributor Author

run java8 tests

@codelipenghui
Copy link
Contributor Author

run java8 tests

@codelipenghui
Copy link
Contributor Author

@sijie Please help review this PR again

@codelipenghui codelipenghui modified the milestones: 2.4.3, 2.5.0 Nov 25, 2019
@sijie
Copy link
Member

sijie commented Nov 25, 2019

@codelipenghui are you going to include this fix in 2.5.0 or shall we move it to 2.5.1 or 2.6.0?

@codelipenghui
Copy link
Contributor Author

codelipenghui commented Nov 27, 2019 via email

@sijie sijie modified the milestones: 2.5.0, 2.5.1 Nov 27, 2019
@codelipenghui
Copy link
Contributor Author

@sijie I have addressed your comments, PTAL.

@codelipenghui
Copy link
Contributor Author

run java8 tests

@codelipenghui
Copy link
Contributor Author

run java8 tests
run integration tests

@codelipenghui
Copy link
Contributor Author

run integration tests

1 similar comment
@codelipenghui
Copy link
Contributor Author

run integration tests

@codelipenghui codelipenghui merged commit 602f1c2 into apache:master Jan 9, 2020
@sijie sijie modified the milestones: 2.5.1, 2.6.0 Jan 22, 2020
jiazhai pushed a commit that referenced this pull request Feb 17, 2020
…ation. (#5572)

### Motivation

Currently, disable the topic auto creation will cause consumer create failed on a partitioned topic. Since the partitioned topic is already created, so we should handle the topic partition create when disable the topic auto creation.

### Modifications

By default, create partitioned topics also try to create all partitions, and if create partitions failed, users can use `create-missed-partitions` to repair.

If users already have a partitioned topic without created partitions, can also use `create-missed-partitions` to repair.
(cherry picked from commit 602f1c2)
@jiazhai
Copy link
Member

jiazhai commented Feb 17, 2020

done the cherry-pick to branch-2.5

tuteng pushed a commit that referenced this pull request Apr 13, 2020
…ation. (#5572)

### Motivation

Currently, disable the topic auto creation will cause consumer create failed on a partitioned topic. Since the partitioned topic is already created, so we should handle the topic partition create when disable the topic auto creation.

### Modifications

By default, create partitioned topics also try to create all partitions, and if create partitions failed, users can use `create-missed-partitions` to repair.

If users already have a partitioned topic without created partitions, can also use `create-missed-partitions` to repair.

(cherry picked from commit 602f1c2)
jiazhai pushed a commit to jiazhai/pulsar that referenced this pull request May 18, 2020
…ation. (apache#5572)

### Motivation

Currently, disable the topic auto creation will cause consumer create failed on a partitioned topic. Since the partitioned topic is already created, so we should handle the topic partition create when disable the topic auto creation.

### Modifications

By default, create partitioned topics also try to create all partitions, and if create partitions failed, users can use `create-missed-partitions` to repair.

If users already have a partitioned topic without created partitions, can also use `create-missed-partitions` to repair.
(cherry picked from commit 602f1c2)
merlimat pushed a commit to merlimat/pulsar that referenced this pull request Jun 30, 2020
…ation. (apache#5572)

Currently, disable the topic auto creation will cause consumer create failed on a partitioned topic. Since the partitioned topic is already created, so we should handle the topic partition create when disable the topic auto creation.

By default, create partitioned topics also try to create all partitions, and if create partitions failed, users can use `create-missed-partitions` to repair.

If users already have a partitioned topic without created partitions, can also use `create-missed-partitions` to repair.
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
…ation. (apache#5572)

### Motivation

Currently, disable the topic auto creation will cause consumer create failed on a partitioned topic. Since the partitioned topic is already created, so we should handle the topic partition create when disable the topic auto creation.

### Modifications

By default, create partitioned topics also try to create all partitions, and if create partitions failed, users can use `create-missed-partitions` to repair.

If users already have a partitioned topic without created partitions, can also use `create-missed-partitions` to repair.
@codelipenghui codelipenghui deleted the issue-5565 branch October 27, 2020 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/2.5.1 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zookeeper znodes not created for partitioned topics if allowAutoTopicCreation=false
4 participants