junrao commented on code in PR #15685:
URL: https://github.com/apache/kafka/pull/15685#discussion_r1613728690
##########
core/src/main/scala/kafka/tools/StorageTool.scala:
##########
@@ -109,6 +111,52 @@ object StorageTool extends Logging {
}
}
+ private def validateMetadataVersion(metadataVersion: MetadataVersion,
config: Option[KafkaConfig]): Unit = {
+ if (!metadataVersion.isKRaftSupported) {
+ throw new TerseFailure(s"Must specify a valid KRaft metadata.version of
at least ${MetadataVersion.IBP_3_0_IV0}.")
+ }
+ if (!metadataVersion.isProduction) {
+ if (config.get.unstableMetadataVersionsEnabled) {
+ System.out.println(s"WARNING: using pre-production metadata.version
$metadataVersion.")
+ } else {
+ throw new TerseFailure(s"The metadata.version $metadataVersion is not
ready for production use yet.")
+ }
+ }
+ }
+
+ private[tools] def generateFeatureRecords(metadataRecords:
ArrayBuffer[ApiMessageAndVersion],
+ metadataVersion: MetadataVersion,
+ specifiedFeatures: Map[String,
java.lang.Short],
+ allFeatures: List[Features],
+ usesVersionDefault: Boolean): Unit
= {
+ // If we are using --version-default, the default is based on the metadata
version.
+ val metadataVersionForDefault = if (usesVersionDefault)
Optional.of(metadataVersion) else Optional.empty[MetadataVersion]()
Review Comment:
> Originally this did not need to be a production ready MV even if the
feature is production, but I think we are now flipping this around and saying
the feature is production ready iff the MV is production ready.
If there is a 1-to-1 mapping from feature to MV, reasoning about production
readiness in one place seems simpler?
--
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]