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

[improve][broker] Skip auto-creation for topics with "-partition-" suffix missing a valid partition number #23627

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zjxxzjwang
Copy link

@zjxxzjwang zjxxzjwang commented Nov 22, 2024

Motivation

If you actively create a topic with "-partition--x" (x is an integer)(for example, "peisisten://tenant-name/ns-name/topic-name-partition--1"), the topic can be created successfully, and a node with partition 3 will be attached to the zk. But it is not a partition topic

Modifications

By modifying the isAllowAutoTopicCreationAsync logic () method, when the topic name contains "- partiton - x" (x is an integer), trigger logic returns false

Clipboard_Screenshot_1732245902

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 22, 2024
@zjxxzjwang zjxxzjwang marked this pull request as draft November 22, 2024 03:29
@zjxxzjwang
Copy link
Author

@lhotari Hello lhotari, this pr(#23562) merger was terminated because of the wrong deletion of the warehouse before. Now I have submitted the same pr again, please approve, thank you!

@@ -3532,6 +3532,12 @@ private CompletableFuture<Boolean> isAllowAutoTopicCreationAsync(final TopicName
return CompletableFuture.completedFuture(true);
}

// If this topic name contains "-partition--x" , not allow to be created automatically.
Copy link
Member

@lhotari lhotari Nov 22, 2024

Choose a reason for hiding this comment

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

This would be a more accurate description:

Suggested change
// If this topic name contains "-partition--x" , not allow to be created automatically.
// Skip auto-creation for topics with "-partition-" suffix missing a valid partition number

@lhotari lhotari changed the title [improve][broker]Restrict the creation of topics with "-partition--x" [improve][broker] Skip auto-creation for topics with "-partition-" suffix missing a partition number Nov 22, 2024
@lhotari lhotari changed the title [improve][broker] Skip auto-creation for topics with "-partition-" suffix missing a partition number [improve][broker] Skip auto-creation for topics with "-partition-" suffix missing a positive partition number Nov 22, 2024
@lhotari lhotari changed the title [improve][broker] Skip auto-creation for topics with "-partition-" suffix missing a positive partition number [improve][broker] Skip auto-creation for topics with "-partition-" suffix missing a valid partition number Nov 22, 2024
@lhotari
Copy link
Member

lhotari commented Nov 22, 2024

@lhotari Hello lhotari, this pr(#23562) merger was terminated because of the wrong deletion of the warehouse before. Now I have submitted the same pr again, please approve, thank you!

@zjxxzjwang Makes sense. Please check the review comment about the code comment and the PR title change that I made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants