-
Notifications
You must be signed in to change notification settings - Fork 14.8k
MINOR: Cleanup 'share' from group.coordinator.rebalance.protocols #20466
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
MINOR: Cleanup 'share' from group.coordinator.rebalance.protocols #20466
Conversation
… value. Share Groups should instead be enabled through the share.version
There was a problem hiding this 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.
|
@elmoctarebnou There are some build failures. Please check the logs and resolve. For example: |
…nd test rejecting 'share'
|
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. |
|
Hi @AndrewJSchofield all tests are passing except for the ones already marked as flaky, which seem unrelated to this change. |
There was a problem hiding this 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)) | ||
|
|
||
|
|
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
@elmoctarebnou could you please fix the conflicts? |
|
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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])), |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@AndrewJSchofield What do you think about this PR? |
It's fine. I slightly prefer to permit and ignore |
This seems to be related to a compatibility issue. The config @elmoctarebnou what's your take on this? |
|
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 |
sounds good to me 😃 |
Works for me too. Thanks. |
|
@elmoctarebnou Could you please merge |
…rebalance-protocols
There was a problem hiding this 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.
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]