-
Notifications
You must be signed in to change notification settings - Fork 15.1k
KAFKA-17011: Fix a bug preventing features from supporting v0 #16421
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
Changes from all commits
1c1e556
6235178
1dc5f99
c0e3c7c
3e07a3b
ab1b566
234ea4b
04ecd25
890c184
6ad6749
c1ba1f5
85a827a
d6eb186
f4bd3cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ | |
| import org.apache.kafka.common.protocol.Errors; | ||
|
|
||
| import java.nio.ByteBuffer; | ||
| import java.util.Iterator; | ||
|
|
||
| public class BrokerRegistrationRequest extends AbstractRequest { | ||
|
|
||
|
|
@@ -45,7 +46,21 @@ public short oldestAllowedVersion() { | |
|
|
||
| @Override | ||
| public BrokerRegistrationRequest build(short version) { | ||
| return new BrokerRegistrationRequest(data, version); | ||
| if (version < 4) { | ||
| // Workaround for KAFKA-17011: for BrokerRegistrationRequest versions older than 4, | ||
| // translate minSupportedVersion = 0 to minSupportedVersion = 1. | ||
| BrokerRegistrationRequestData newData = data.duplicate(); | ||
| for (Iterator<BrokerRegistrationRequestData.Feature> iter = newData.features().iterator(); | ||
|
chia7712 marked this conversation as resolved.
|
||
| iter.hasNext(); ) { | ||
| BrokerRegistrationRequestData.Feature feature = iter.next(); | ||
| if (feature.minSupportedVersion() == 0) { | ||
| feature.setMinSupportedVersion((short) 1); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is another issue caused by changing the version from 0 to 1. #15685 add the check which assumes the "default version" is 0 Hence, the features having min=1 can NOT pass the check. see following error message:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chia7712 Thanks. Is there a way to reproduce this (e.g. an existing test)?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
run the following command with #17084
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Originally I thought that we could not set version 0 with the storage or update tools since it would treat it as disabling the feature. But @dajac pointed out to me that this is happening by setting the MV and that picks default features. However, the min version 1 should only be the case for older request versions. I thought we fixed this to so we wouldn't have the requirement for version 4 and for 4.0 where group version is introduced.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I last talked to Colin about this, I believe he said we could not disable the feature if the min version is > 0.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@cmccabe : Could you confirm if this is case? How would people upgrade from an old release where a feature is not turned on?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suspect you have to upgrade the feature before the upgrade to the new release, but we can let Colin confirm.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checked with Colin offline. To summarize, if we do increase minVersion in the future, we need to bump up the default version for that feature. An old release may need to first upgrade to a bridge release where the new default version could be set. Given that, we don't need to change the logic in ClusterControlManager.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I will sync it to KAFKA-17429 and #17128 |
||
| } | ||
| } | ||
| return new BrokerRegistrationRequest(newData, version); | ||
| } else { | ||
| return new BrokerRegistrationRequest(data, version); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.