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

feat: Initial support for cooperative-sticky rebalancing #407

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

untitaker
Copy link
Member

Fix one bug in StreamProcessor where it assumed the passed assignments
are replacing the old ones.

Our consumer backends mostly work as-is, and are already passing the
right values in callbacks.

Fix one bug in StreamProcessor where it assumed the passed assignments
are replacing the old ones.

Our consumer backends mostly work as-is, and are already passing the
right values in callbacks.
@untitaker untitaker requested review from a team as code owners December 13, 2024 01:06
Copy link
Member

@lynnagara lynnagara left a comment

Choose a reason for hiding this comment

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

Looks good!

Were you wanting to merge + publish as-is or do more testing against this branch?

Is it worth including a test that fails against the current cluster but works with newer versions? Attempting to commit on an existing partition during a rebalance might do it.

# ProcessingStrategyFactory that we made in Rust: Remove
# create_with_partitions, replace with create +
# update_partitions
logger.error(
Copy link
Member

Choose a reason for hiding this comment

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

can we downgrade to warning if this is expected to happen on a regular basis?

@@ -245,6 +256,10 @@ def test_consumer_polls_when_paused(self) -> None:
assert consumer.paused() == []


class TestKafkaStreamsIncrementalRebalancing(TestKafkaStreams):
Copy link
Member

Choose a reason for hiding this comment

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

unused?

# Second partition assigned
offsets_p1 = {Partition(topic, 1): 0}
assignment_callback(offsets_p1)

create_args, _ = factory.create_with_partitions.call_args
assert factory.create_with_partitions.call_count == 2
assert create_args[1] == offsets_p1
assert create_args[1] == {**offsets_p1, **offsets_p0}
Copy link
Member

Choose a reason for hiding this comment

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

was this test change related to your other changes? since there's no cooperative rebalancing here, seems like the assertions should stay the same?

@@ -161,6 +161,7 @@ def __init__(
)

configuration = dict(configuration)
self.__assignment_strategy = configuration.get("partition.assignment.strategy")
Copy link
Member

Choose a reason for hiding this comment

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

sorry i said the wrong thing earlier, this should be group.protocol

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