Skip to content

KAFKA-18687: Setting the subscriptionMetadata during conversion to consumer group #19790

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 3 commits into
base: trunk
Choose a base branch
from

Conversation

dongnuo123
Copy link
Contributor

@dongnuo123 dongnuo123 commented May 22, 2025

When a consumer protocol static member replaces an existing member in a
classic group, it's not necessary to recompute the assignment. However,
it happens anyway.

In
ConsumerGroup.fromClassicGroup,
we don't set the group's subscriptionMetadata. Later in the consumer
group heartbeat, we call
updateSubscriptionMetadata
,
which notices that the group's subscriptionMetadata needs an
update

and bumps the epoch. Since the epoch is bumped, we recompute the
assignment
.

As a fix, this patch sets the subscriptionMetadata in
ConsumerGroup.fromClassicGroup.

@github-actions github-actions bot added triage PRs from the community small Small PRs labels May 22, 2025
@dajac dajac added KIP-848 The Next Generation of the Consumer Rebalance Protocol and removed triage PRs from the community labels May 23, 2025
@github-actions github-actions bot added the core Kafka Broker label May 23, 2025
Comment on lines -2488 to -2489
// Top level error will equal to the first partition level error
assertFutureThrows(classOf[GroupSubscribedToTopicException], offsetDeleteResult.all())
Copy link
Contributor Author

@dongnuo123 dongnuo123 May 23, 2025

Choose a reason for hiding this comment

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

Removed it because offsetDeleteResult.all() throws the first exception it sees in the result topicPartition map but the sequence of the entries is not deterministic

test_topic-0 --> GroupSubscribedToTopicException
foo-0        --> UnknownTopicOrPartitionException

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Kafka Broker KIP-848 The Next Generation of the Consumer Rebalance Protocol small Small PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants