Skip to content

Conversation

@elmoctarebnou
Copy link
Contributor

@elmoctarebnou elmoctarebnou commented Sep 3, 2025

Cleanup 'share' from group.coordinator.rebalance.protocols as a valid
value. Share Groups should instead be enabled through the share.version

Reviewers: Andrew Schofield [email protected], jimmy
[email protected], TaiJuWu [email protected], Chia-Ping
Tsai [email protected]

… value. Share Groups should instead be enabled through the share.version
Copy link
Member

@AndrewJSchofield AndrewJSchofield left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

@AndrewJSchofield AndrewJSchofield added KIP-932 Queues for Kafka ci-approved and removed triage PRs from the community labels Sep 3, 2025
@AndrewJSchofield AndrewJSchofield changed the title Cleanup 'share' from group.coordinator.rebalance.protocols MINOR: Cleanup 'share' from group.coordinator.rebalance.protocols Sep 3, 2025
@github-actions github-actions bot added the tests Test fixes (including flaky tests) label Sep 3, 2025
@AndrewJSchofield
Copy link
Member

@elmoctarebnou There are some build failures. Please check the logs and resolve. For example:

Error:  /home/runner/work/kafka/kafka/core/src/test/scala/unit/kafka/server/KafkaConfigTest.scala:1789:9: local var config in method testGroupCoordinatorRebalanceProtocols is never updated: consider using immutable val

@elmoctarebnou
Copy link
Contributor Author

Thanks, @AndrewJSchofield — I fixed the error you pointed out. I also chatted with @clolov , and he suggested adding a small test to validate that "share" is not included in group.coordinator.rebalance.protocols, which I’ve now added.

@elmoctarebnou
Copy link
Contributor Author

Hi @AndrewJSchofield all tests are passing except for the ones already marked as flaky, which seem unrelated to this change.

Copy link
Contributor

@JimmyWang6 JimmyWang6 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

props.put(GroupCoordinatorConfig.GROUP_COORDINATOR_REBALANCE_PROTOCOLS_CONFIG, "consumer")
assertThrows(classOf[ConfigException], () => KafkaConfig.fromProps(props))


Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extra blank.

Group.GroupType.CLASSIC.toString(),
Group.GroupType.CONSUMER.toString(),
Group.GroupType.STREAMS.toString());
public static final List<String> GROUP_COORDINATOR_REBALANCE_PROTOCOLS_ALLOWED = List.of(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could reuse the GROUP_COORDINATOR_REBALANCE_PROTOCOLS_DEFAULT constant since they are exactly the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @JimmyWang6 for the comment. I’ll update so ALLOWED just references DEFAULT.

@AndrewJSchofield
Copy link
Member

Requesting review from @dajac since he's most knowledgeable about this config. I'm not certain the change is necessary or worthwhile given that this config is possibly being deprecated soon.


// This is OK.
// Including "share" should be rejected.
props.put(GroupCoordinatorConfig.GROUP_COORDINATOR_REBALANCE_PROTOCOLS_CONFIG, "classic,consumer,share")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we delete share here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, I miss something, please ignore this comment.

@chia7712
Copy link
Member

@elmoctarebnou could you please fix the conflicts?

@elmoctarebnou
Copy link
Contributor Author

elmoctarebnou commented Sep 25, 2025

Thank you @chia7712 for pointing out the conflict, somehow I missed this.

Group.GroupType.CLASSIC.toString(),
Group.GroupType.CONSUMER.toString(),
Group.GroupType.STREAMS.toString());
public static final List<String> GROUP_COORDINATOR_REBALANCE_PROTOCOLS_ALLOWED = GROUP_COORDINATOR_REBALANCE_PROTOCOLS_DEFAULT;
Copy link
Member

Choose a reason for hiding this comment

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

why not using GROUP_COORDINATOR_REBALANCE_PROTOCOLS_DEFAULT directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chia7712 thank you for the comment! The GROUP_COORDINATOR_REBALANCE_PROTOCOLS_ALLOWED is just for readability.

// Group coordinator configs
.define(GROUP_COORDINATOR_REBALANCE_PROTOCOLS_CONFIG, LIST, GROUP_COORDINATOR_REBALANCE_PROTOCOLS_DEFAULT,
ConfigDef.ValidList.in(false, Group.GroupType.documentValidValues()), MEDIUM, GROUP_COORDINATOR_REBALANCE_PROTOCOLS_DOC)
ConfigDef.ValidList.in(GROUP_COORDINATOR_REBALANCE_PROTOCOLS_ALLOWED.toArray(new String[0])),
Copy link
Member

Choose a reason for hiding this comment

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

not sure why share is not controlled by group.coordinator.rebalance.protocols? By contrast, stream and consumer could be disabled by group.coordinator.rebalance.protocols

Copy link
Member

Choose a reason for hiding this comment

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

That's because share groups are controlled by a feature. This config was created before the features were implemented to turn on KIP-848 and KIP-932. I understand the plan is to deprecate and remove it entirely. It's a really bad idea having a broker-level config that controls this because individual brokers might be misconfigured and a cluster is in a mixed state. That's why a feature is so much better.

Copy link
Member

Choose a reason for hiding this comment

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

@AndrewJSchofield Thanks for the response. Do we have a KIP that covers deprecating this config? Since each protocol already maintains its own feature version, it feels like the right time to deprecate it. Otherwise, exposing an incomplete public config seems a bit odd to me

Copy link
Member

Choose a reason for hiding this comment

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

No KIP yet. But then KIP-932 says that share groups are enabled by a feature, and not group.coordinator.rebalance.protocols.

Copy link
Member

Choose a reason for hiding this comment

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

@chia7712 I do understand your point but I was not expecting other group types to use this config after KIP-848. It would be acceptable to me for share groups to honour this config in trunk and AK 4.2. Let me know what you think.

Copy link
Member

Choose a reason for hiding this comment

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

I do understand your point but I was not expecting other group types to use this config after KIP-848. It would be acceptable to me for share groups to honour this config in trunk and AK 4.2. Let me know what you think.

In fact, I’d prefer to raise a KIP to deprecate group.coordinator.rebalance.protocols in trunk and AK 4.2. Let’s leave it as is, since extending a deprecated config would be a bit odd. I’ve opened KAFKA-19740 for this.

Copy link
Member

Choose a reason for hiding this comment

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

@dajac I think you're planning a KIP to complete the new consumer group protocol migration, so I expect this is on your radar.

@elmoctarebnou
Copy link
Contributor Author

Related PR: apache/kafka-site#717

public static final ConfigDef CONFIG_DEF = new ConfigDef()
// Group coordinator configs
.define(GROUP_COORDINATOR_REBALANCE_PROTOCOLS_CONFIG, LIST, GROUP_COORDINATOR_REBALANCE_PROTOCOLS_DEFAULT,
ConfigDef.ValidList.in(false, Group.GroupType.documentValidValues()), MEDIUM, GROUP_COORDINATOR_REBALANCE_PROTOCOLS_DOC)
Copy link
Member

Choose a reason for hiding this comment

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

It should be ConfigDef.ValidList.in(false, GROUP_COORDINATOR_REBALANCE_PROTOCOLS_ALLOWED.toArray(new String[0])), right? The empty GROUP_COORDINATOR_REBALANCE_PROTOCOLS_CONFIG is illegal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chia7712 You're right — thanks for catching that! I’ve updated the validation to disallow empty lists

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

LGTM

@chia7712
Copy link
Member

chia7712 commented Oct 6, 2025

@AndrewJSchofield What do you think about this PR?

@AndrewJSchofield
Copy link
Member

@AndrewJSchofield What do you think about this PR?

It's fine. I slightly prefer to permit and ignore "share" in the config, but I know it's just a matter of taste.

@chia7712
Copy link
Member

chia7712 commented Oct 7, 2025

I slightly prefer to permit and ignore "share" in the config, but I know it's just a matter of taste.

This seems to be related to a compatibility issue. The config group.coordinator.rebalance.protocols=classic,share should not throw an exception, even though share is a no-op

@elmoctarebnou what's your take on this?

@elmoctarebnou
Copy link
Contributor Author

Thanks @chia7712 and @AndrewJSchofield for the feedback — I agree that maintaining compatibility makes sense here. I’ll update the PR so that "share" is accepted in group.coordinator.rebalance.protocols but treated as a no-op (ignored internally with a warning). Let me know if you’re good with that approach, or if you’d prefer a different handling.

@chia7712
Copy link
Member

chia7712 commented Oct 7, 2025

I’ll update the PR so that "share" is accepted in group.coordinator.rebalance.protocols but treated as a no-op (ignored internally with a warning)

sounds good to me 😃

@AndrewJSchofield
Copy link
Member

I’ll update the PR so that "share" is accepted in group.coordinator.rebalance.protocols but treated as a no-op (ignored internally with a warning). Let me know if you’re good with that approach, or if you’d prefer a different handling.

Works for me too. Thanks.

@chia7712
Copy link
Member

@elmoctarebnou Could you please merge trunk to bring in the recent CI updates?

Copy link
Member

@AndrewJSchofield AndrewJSchofield 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 to me.

@chia7712 chia7712 merged commit 781bc7a into apache:trunk Oct 16, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved clients core Kafka Broker group-coordinator KIP-932 Queues for Kafka small Small PRs tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants