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

backend: add update partition count dataplane api #1638

Open
wants to merge 4 commits into
base: release-2.8
Choose a base branch
from

Conversation

bojand
Copy link
Member

@bojand bojand commented Mar 10, 2025

This adds dataplane API to update partition counts for topic(s).
This has been asked by numerous customers. While working on v1 migration I took a little bit of time to add this in a separate work for a quick follow up PR. This is that PR.
My idea is to merge into release 2.8 branch. And then also do equivalent PR into master when AuthN rework is merged.

Copy link

github-actions bot commented Mar 10, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / push-module (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 10, 2025, 2:33 PM

@bojand bojand marked this pull request as ready for review March 10, 2025 00:29
@bojand bojand requested review from weeco and sago2k8 March 10, 2025 00:29
"github.com/twmb/franz-go/pkg/kadm"
)

// AddPartitionsToTopics adds partition counts to topics.
Copy link
Contributor

Choose a reason for hiding this comment

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

Comments are somewhat weird for these functions

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated comments.

};
}

rpc SetTopicPartitions(SetTopicPartitionsRequest) returns (SetTopicPartitionsResponse) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if you set fewer partitions than you currently have? Will partitions be just deleted with the data? Will the data be moved onto the remaining partitions and only then deleted? Etc.

I think we should also clearly point out that changing the partition count is going to impact ordering guarantees - depending on the Partitioner. The most commonly used partitioners determine it based on the hash of the key and modulo it by number of partitions. So the same won't go to the same partition anymore. I think we need to point this out as a warning in all the descriptions.

Copy link
Member Author

@bojand bojand Mar 10, 2025

Choose a reason for hiding this comment

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

What happens if you set fewer partitions than you currently have?

That's an invalid request that's prevented at least at franz-go level (docs). Possibly at protocol / broker level as well.. Can't find conclusively the answer from quick search. UDATE: I have confirmed the enforcement is done at broker.

I have updated docs in proto definitions too.

bojand and others added 3 commits March 10, 2025 10:27
Co-authored-by: Martin Schneppenheim <23424570+weeco@users.noreply.github.com>
Co-authored-by: Martin Schneppenheim <23424570+weeco@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants