mannoopj commented on PR #20707:
URL: https://github.com/apache/kafka/pull/20707#issuecomment-4491211040
> @mannoopj there are test failures please take a look.
The integration tests failure can be mapped out this way:
`On trunk:
1. Test sets @ClusterFeature(feature = Feature.GROUP_VERSION, version = 0)
2. RaftClusterInvocationContext builds newFeatureLevels map with
group.version=0
3. BootstrapMetadata.fromVersions() skips level 0 —
nodes.bootstrapMetadata() has no GROUP_VERSION record (implicitly 0)
4. KafkaClusterTestKit.formatNode() loops through
bootstrapMetadata.records() — no GROUP_VERSION record found, so
formatter.setFeatureLevel("group.version",
...) is never called
5. Formatter's calculateEffectiveFeatureLevels() sees GROUP_VERSION is
missing, fills in default (e.g. 1) — writes bootstrap.checkpoint with
GROUP_VERSION=1
6. bootstrap.checkpoint is never read — KafkaClusterTestKit doesn't use
KafkaRaftServer.initializeLogDirs()
7. ControllerServer gets nodes.bootstrapMetadata() directly — no
GROUP_VERSION record
8. ActivationRecordsGenerator writes bootstrapMetadata.records() to
metadata log — no GROUP_VERSION record
9. Broker sees no GROUP_VERSION in metadata log — level 0 — API disabled —
test passes
On your branch:
1. Test sets @ClusterFeature(feature = Feature.GROUP_VERSION, version = 0)
2. RaftClusterInvocationContext builds newFeatureLevels map with
group.version=0
3. BootstrapMetadata.fromVersions() skips level 0 —
nodes.bootstrapMetadata() has no GROUP_VERSION record (implicitly 0)
4. KafkaClusterTestKit.formatNode() loops through
bootstrapMetadata.records() — no GROUP_VERSION record found, so
formatter.setFeatureLevel("group.version",
...) is never called
5. Formatter's calculateEffectiveFeatureLevels() sees GROUP_VERSION is
missing, fills in default (e.g. 1) — writes the zero checkpoint with
GROUP_VERSION=1
6. ControllerServer gets nodes.bootstrapMetadata() directly — no
GROUP_VERSION record (still correct at this point)
7. handleLoadBootstrap reads the zero checkpoint — finds GROUP_VERSION=1 —
overwrites bootstrapMetadata with GROUP_VERSION=1
8. ActivationRecordsGenerator writes the overwritten
bootstrapMetadata.records() to metadata log — GROUP_VERSION=1
9. Broker sees GROUP_VERSION=1 in metadata log — level 1 — API enabled —
test fails`
This seems like an existing bug that never manifested. The problem now is
`Formatter' needs a way to know if a feature is 0 or not. Since not writing
`FeatureLevelRecords` set to 0 is correct and wanted behavior i think we need
to pass in some sort of explicit list of features so that
`calculateEffectiveFeatureLevels` can set these to 0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]