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

fix: support existing deprecated Rebalance.Strategy field usage #2352

Merged
merged 2 commits into from
Oct 3, 2022
Merged

fix: support existing deprecated Rebalance.Strategy field usage #2352

merged 2 commits into from
Oct 3, 2022

Conversation

wathenjiang
Copy link
Contributor

see #2351

config.go Outdated
@@ -794,6 +794,12 @@ func (c *Config) Validate() error {
return ConfigurationError("ReadCommitted requires Version >= V0_11_0_0")
}

// backward compatibility on Rebalance Strategy
Copy link
Contributor

Choose a reason for hiding this comment

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

The code works, but I'm not sure if it's good to modify the config in Validation method.

And btw there is no need to clear c.Consumer.Group.Rebalance.GroupStrategies here.
Because c.Consumer.Group.Rebalance.Strategy takes precedence of c.Consumer.Group.Rebalance.GroupStrategies in sarama (
https://github.com/Shopify/sarama/blob/v1.37.0/consumer_group.go#L443-L453 & https://github.com/Shopify/sarama/blob/v1.37.0/consumer_group.go#L333-L340)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with you. So just delete the case segment woud be enough. Keep no editing in Validation method.

@dnwe dnwe changed the title for config backward compatibility fix: support existing deprecated Rebalance.Strategy field usage Oct 3, 2022
@dnwe dnwe added the fix label Oct 3, 2022
@dnwe dnwe merged commit eaf1def into IBM:main Oct 3, 2022
@dnwe
Copy link
Collaborator

dnwe commented Oct 3, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants