kafka icon indicating copy to clipboard operation
kafka copied to clipboard

KAFKA-17011: Fix a bug preventing features from supporting v0

Open cmccabe opened this issue 1 year ago • 5 comments

As part of KIP-584, brokers expose a range of supported versions for each feature. For example, metadata.version might be supported from 1 to 21. (Note that feature level ranges are always inclusive, so this would include both level 1 and 21.)

These supported ranges are supposed to be able to include 0. For example, it should be possible for a broker to support a kraft.version between 0 and 1. However, in older software versions, there is an assertion in org.apache.kafka.common.feature.SupportedVersionRange that prevents this. This causes problems when the older software attempts to deserialize an ApiVersionsResponse containing such a range.

In order to resolve this dilemma, this PR bumps the version of ApiVersionsRequest from 3 to 4. Clients which send v4 promise to be able to handle ranges including 0. Clients which send v3 will not be exposed to these ranges -- the feature will simply be omitted from the response. This work is part of KIP-1022.

cmccabe avatar Jun 21 '24 22:06 cmccabe

Did we check the kraft upgrade system tests? I can kick off a job. Looks like there may also be some issue with the build.

jolshan avatar Jun 24 '24 20:06 jolshan

It seems simpler to just pass the ApiVersionsResponse version as a parameter to the Supplier (hence making it a Function, I guess)

Updated.

cmccabe avatar Jun 25 '24 00:06 cmccabe

Let's take a look at testUnsupportedApiVersionsRequestWithVersionProvidedByTheBroker

jolshan avatar Jun 25 '24 15:06 jolshan

It looks like the test was checking the ApiVersionsRequest header version against 3. So it needed to be updated to 4

cmccabe avatar Jun 25 '24 17:06 cmccabe

The test failures pass locally.

cmccabe avatar Jun 26 '24 20:06 cmccabe

https://github.com/apache/kafka/pull/16183 will wait for this PR in order to not break tests.

jolshan avatar Jul 03 '24 17:07 jolshan

Looks like there are still quite a few failures for ApiVersionsRequestTest and BrokerFeaturesTest

jolshan avatar Jul 10 '24 16:07 jolshan

The context here is that we’re adding kraft.version in 3.9. But not in this PR. I did add kraft.version to supportedFeatures, simply so that I could verify that the RPC results looked like what I wanted. This will cause no compatibility problems since there is no way to set kraft.version yet.

cmccabe avatar Jul 10 '24 16:07 cmccabe

Test failures are unrelated. I will merge.

jolshan avatar Jul 10 '24 23:07 jolshan