You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/08/24 21:07:50 UTC
[GitHub] [kafka] hachikuji commented on a diff in pull request #12513: KAFKA-14177: Correctly support older kraft versions without FeatureLevelRecord
hachikuji commented on code in PR #12513:
URL: https://github.com/apache/kafka/pull/12513#discussion_r954300741
##########
core/src/test/scala/unit/kafka/tools/StorageToolTest.scala:
##########
@@ -191,18 +191,26 @@ Found problem:
@Test
def testDefaultMetadataVersion(): Unit = {
val namespace = StorageTool.parseArguments(Array("format", "-c", "config.props", "-t", "XcZZOzUqS4yHOjhMQB6JLQ"))
- val mv = StorageTool.getMetadataVersion(namespace)
+ val mv = StorageTool.getMetadataVersion(namespace, "")
assertEquals(MetadataVersion.latest().featureLevel(), mv.featureLevel(),
"Expected the default metadata.version to be the latest version")
}
+ @Test
+ def testConfiguredMetadataVersion(): Unit = {
+ val namespace = StorageTool.parseArguments(Array("format", "-c", "config.props", "-t", "XcZZOzUqS4yHOjhMQB6JLQ"))
+ val mv = StorageTool.getMetadataVersion(namespace, MetadataVersion.IBP_3_3_IV2.toString)
+ assertEquals(MetadataVersion.IBP_3_3_IV2.featureLevel(), mv.featureLevel(),
+ "Expected the default metadata.version to be 3.3-IV2")
+ }
+
@Test
def testMetadataVersionFlags(): Unit = {
def parseMetadataVersion(strings: String*): MetadataVersion = {
var args = mutable.Seq("format", "-c", "config.props", "-t", "XcZZOzUqS4yHOjhMQB6JLQ")
args ++= strings
val namespace = StorageTool.parseArguments(args.toArray)
- StorageTool.getMetadataVersion(namespace)
+ StorageTool.getMetadataVersion(namespace, "")
Review Comment:
This test fails because `""` is not a valid IBP. I think this gets back to my point about the dubious use of `""` as a sentinel. The method here expects `null` instead. I think we should try to be consistent.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org