kafka icon indicating copy to clipboard operation
kafka copied to clipboard

KAFKA-13990: KRaft controller should return right features in ApiVersionResponse

Open dengziming opened this issue 2 years ago • 2 comments

More detailed description of your change

Updating metadata.version using AdminClient will fail with the following exception:

java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.InvalidUpdateVersionException: Invalid update version 7 for feature metadata.version. Controller 3000 does not support this feature.

This is because we just return empty supported features in Controller ApiVersionResponse, so QuorumFeatures.reasonNotSupported will always assume we don't support this version.

Summary of testing strategy (including rationale) KRaftClusterTest.testUpdateMetadataVersion

Committer Checklist (excluded from commit message)

  • [ ] Verify design and implementation
  • [ ] Verify test coverage and CI build status
  • [ ] Verify documentation (including upgrade notes)

dengziming avatar Jun 14 '22 11:06 dengziming

Hello @cmccabe , in #12207 you moved the validation from FeatureControlManager.replay to FeatureControlManager.updateFeature, but it's still failing since controller doesn't return right supported versions in ApiVersionResponse.

dengziming avatar Jun 14 '22 11:06 dengziming

This is an issue of big influence since it will prevent us from upgrading KRaft cluster, also ping @hachikuji @mumrah

dengziming avatar Aug 24 '22 02:08 dengziming

Thanks for finding this, @dengziming . It is a great find and definitely a 3.3 blocker.

cmccabe avatar Aug 31 '22 16:08 cmccabe

So, the reason we didn't notice this bug earlier is that it doesn't affect single-node clusters. And in the multi-node ducktape test that I wrote, the upgrade command was failing but we didn't notice because the error code returned was 0 (success). I will open a PR to fix the kafka-features.sh return code.

cmccabe avatar Aug 31 '22 18:08 cmccabe