Skip to content

Support Create Partitions #623

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

BlueCollarChris
Copy link

Adds in the ability to create partitions for an existing topic.
Adds in the ability for clients to synchronize their topic metadata to pick up new partitions and start a producer.

@BlueCollarChris
Copy link
Author

Working on tests still but posting for initial feedback

@zmstone
Copy link
Contributor

zmstone commented Mar 20, 2025

thank you for the PR @BlueCollarChris
could you add an entry in CHANGELOG.md

@BlueCollarChris
Copy link
Author

Just seeing the comments now and will get back to you on Monday. I had been exploring a different route locally where the sync is done outside the client in a linked genserver. I wasn't sure if the sync process were to block the client would be disrupted from handling other requests. I'll see about getting those changes up shortly.

interval = Interval
} = State
) ->
sync_partitions(Client, Sup, Config),
Copy link
Author

Choose a reason for hiding this comment

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

This ensure the new partitions get a producer but then we need to tell the client to update the metadata so it can use the new partition.

brod_supervisor3:start_child(SupPid, Spec).

%% @doc Dynamically start a per partition producer
-spec start_producer(pid(), pid(), brod:topic(), non_neg_integer(), brod:producer_config()) ->
Copy link
Author

Choose a reason for hiding this comment

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

variant for starting just the partition producer with the correct child spec

@BlueCollarChris
Copy link
Author

@zmstone got the update in I mentioned over the weekend. Is there a specific formatter you recommend looks like the one for my IDE formatted some stuff showing more changes than were there previously. I did make the change to start the partition producer under the brod_supervisor3 as mentioned in your previous comment. Working on the tests for the brod_partitions_sync module still.

@BlueCollarChris BlueCollarChris requested a review from zmstone March 24, 2025 16:27
@zmstone
Copy link
Contributor

zmstone commented Apr 22, 2025

Hi @BlueCollarChris
Thank you for the PR and sorry for the slow review.

About code format: we use https://github.com/WhatsApp/erlfmt
example for ref:
https://github.com/kafka4beam/brod-cli/blob/f8a2784f4ffb7aa70bf8006c2b519ca12991c4f7/rebar.config#L7-L10

Possible to leave code reformat out in this PR? it makes review easier.

Comment on lines +1 to +3
%%%
%%% Copyright (c) 2014-2021 Klarna Bank AB (publ)
%%%
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
%%%
%%% Copyright (c) 2014-2021 Klarna Bank AB (publ)
%%%

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