Skip to content

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

Merged
codelipenghui merged 6 commits into
apache:masterfrom
codelipenghui:issue-5565
Jan 9, 2020
Merged

Fix create consumer on partitioned topic while disable topic auto creation.#5572
codelipenghui merged 6 commits into
apache:masterfrom
codelipenghui:issue-5565

Conversation

@codelipenghui

@codelipenghui codelipenghui commented Nov 6, 2019

Copy link
Copy Markdown
Contributor

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

@sijie sijie left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor Author

run integration tests

@codelipenghui
codelipenghui requested a review from sijie November 12, 2019 07:54
@codelipenghui

Copy link
Copy Markdown
Contributor Author

run java8 tests

@wolfstudy

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@wolfstudy Thanks

@codelipenghui

Copy link
Copy Markdown
Contributor Author

run java8 tests

1 similar comment
@codelipenghui

Copy link
Copy Markdown
Contributor Author

run java8 tests

@codelipenghui

Copy link
Copy Markdown
Contributor Author

run java8 tests

3 similar comments
@codelipenghui

Copy link
Copy Markdown
Contributor Author

run java8 tests

@codelipenghui

Copy link
Copy Markdown
Contributor Author

run java8 tests

@codelipenghui

Copy link
Copy Markdown
Contributor Author

run java8 tests

@codelipenghui

Copy link
Copy Markdown
Contributor Author

@sijie Please help review this PR again

Comment thread pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java Outdated
Comment thread pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java Outdated
@codelipenghui codelipenghui modified the milestones: 2.4.3, 2.5.0 Nov 25, 2019
@sijie

sijie commented Nov 25, 2019

Copy link
Copy Markdown
Member

@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

codelipenghui commented Nov 27, 2019 via email

Copy link
Copy Markdown
Contributor Author

@sijie sijie modified the milestones: 2.5.0, 2.5.1 Nov 27, 2019
@codelipenghui

Copy link
Copy Markdown
Contributor Author

@sijie I have addressed your comments, PTAL.

@codelipenghui

Copy link
Copy Markdown
Contributor Author

run java8 tests

@codelipenghui

Copy link
Copy Markdown
Contributor Author

run java8 tests
run integration tests

@codelipenghui

Copy link
Copy Markdown
Contributor Author

run integration tests

1 similar comment
@codelipenghui

Copy link
Copy Markdown
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

jiazhai commented Feb 17, 2020

Copy link
Copy Markdown
Member

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