ijuma commented on code in PR #18845:
URL: https://github.com/apache/kafka/pull/18845#discussion_r1960528979
##########
metadata/src/main/java/org/apache/kafka/image/FeaturesDelta.java:
##########
@@ -58,7 +59,14 @@ public void finishSnapshot() {
public void replay(FeatureLevelRecord record) {
if (record.name().equals(MetadataVersion.FEATURE_NAME)) {
- metadataVersionChange =
MetadataVersion.fromFeatureLevel(record.featureLevel());
+ // Support for the `metadata.version` feature flag was added in
IBP_3_3_IV0, so it's possible (but unlikely) that we read
+ // records with a feature level that is no longer supported for
clusters that used a pre-release version of 3.3.0.
+ // We automatically fallback to IBP_3_3_IV3 in that case. We use
explicit versions instead of `MINIMUM_VERSION` because
+ // we want to force an explicit decision if we change
`MetadataVersion.MINIMUM_VERSION` in the future.
+ if (record.featureLevel() >= MINIMUM_PERSISTED_FEATURE_LEVEL &&
record.featureLevel() <= MetadataVersion.IBP_3_3_IV3.featureLevel())
+ metadataVersionChange = MetadataVersion.IBP_3_3_IV3;
Review Comment:
I discussed this with a few people and the bit that was missing in the
discussion above is that we generate snapshots every hour by default and hence
this issue is unlikely to ever happen and the workaround is reasonably simple.
I updated the code to remove the fallback and include a helpful message if this
issue occurs.
--
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]