FrankYang0529 commented on code in PR #19345:
URL: https://github.com/apache/kafka/pull/19345#discussion_r2025863364
##########
core/src/test/scala/integration/kafka/admin/RemoteTopicCrudTest.scala:
##########
@@ -441,7 +441,29 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
AlterConfigOp.OpType.SET),
))
assertThrowsException(classOf[InvalidConfigurationException],
- () => admin.incrementalAlterConfigs(configs).all().get(), "Disabling
remote storage feature on the topic level is not supported.")
+ () => admin.incrementalAlterConfigs(configs).all().get(), "It is invalid
to disable remote storage without deleting remote data. " +
+ "If you want to keep the remote data and turn to read only, please set
`remote.storage.enable=true,remote.log.copy.disable=true`. " +
+ "If you want to disable remote storage and delete all remote data,
please set `remote.storage.enable=false,remote.log.delete.on.disable=true`.")
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = Array("kraft"))
+ def
testUpdateTopicConfigWithDisablingRemoteStorageWithDeleteOnDisable(quorum:
String): Unit = {
+ val admin = createAdminClient()
+ val topicConfig = new Properties
+ topicConfig.setProperty(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG,
"true")
+ TestUtils.createTopicWithAdmin(admin, testTopicName, brokers,
controllerServers, numPartitions, numReplicationFactor,
+ topicConfig = topicConfig)
+
+ val configs = new util.HashMap[ConfigResource,
util.Collection[AlterConfigOp]]()
+ configs.put(new ConfigResource(ConfigResource.Type.TOPIC, testTopicName),
+ util.Arrays.asList(
+ new AlterConfigOp(new
ConfigEntry(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, "false"),
+ AlterConfigOp.OpType.SET),
+ new AlterConfigOp(new
ConfigEntry(TopicConfig.REMOTE_LOG_DELETE_ON_DISABLE_CONFIG, "true"),
+ AlterConfigOp.OpType.SET)
+ ))
+ verifyRemoteLogTopicConfigs(topicConfig)
Review Comment:
We have to use `admin.incrementalAlterConfigs(configs).all().get()` here. Or
the configs is not updated to the server. Thanks.
--
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]