Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class DisklessAndRemoteStorageConfigsTest {

private static final String ENABLE_DISKLESS_ERROR = "It is invalid to enable diskless on an already existing topic.";
private static final String DISABLE_DISKLESS_ERROR = "It is invalid to disable diskless.";
private static final String DISKLESS_REMOTE_SET_ERROR = "remote.storage.enable cannot be set if diskless.enable is set to true.";
private static final String DISKLESS_REMOTE_SET_ERROR = "It is not valid to set a value for both diskless.enable and remote.storage.enable.";
private static final String DISABLE_REMOTE_WITHOUT_DELETE_ERROR = "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`.";
Expand Down
4 changes: 2 additions & 2 deletions core/src/test/scala/unit/kafka/log/LogConfigTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class LogConfigTest {
def testDisklessAndRemoteStorageAtCreation(): Unit = {
val kafkaConfig = KafkaConfig.fromProps(TestUtils.createDummyBrokerConfig())
val noExisting: util.Map[String, String] = util.Map.of()
val mutualExclusionError = "remote.storage.enable cannot be set if diskless.enable is set to true."
val mutualExclusionError = "It is not valid to set a value for both diskless.enable and remote.storage.enable."

// Allowed to set diskless.enable=true at creation
assertValid(noExisting, topicProps(TopicConfig.DISKLESS_ENABLE_CONFIG -> "true"), kafkaConfig)
Expand Down Expand Up @@ -474,7 +474,7 @@ class LogConfigTest {
@Test
def testDisklessAndRemoteStorageAtUpdate(): Unit = {
val kafkaConfig = KafkaConfig.fromProps(TestUtils.createDummyBrokerConfig())
val mutualExclusionError = "remote.storage.enable cannot be set if diskless.enable is set to true."
val mutualExclusionError = "It is not valid to set a value for both diskless.enable and remote.storage.enable."
val existingWithoutDisklessOrRemote = util.Map.of(TopicConfig.RETENTION_MS_CONFIG, "1000")
val existingWithDisklessFalse = util.Map.of(TopicConfig.DISKLESS_ENABLE_CONFIG, "false")
val existingWithDisklessTrue = util.Map.of(TopicConfig.DISKLESS_ENABLE_CONFIG, "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ private static void validateDiskless(Map<String, String> existingConfigs,
final boolean hasExplicitRemoteStorage = isRemoteStorageExplicitlySet || wasRemoteStorageExplicitlySet;
if ((isDisklessExplicitlySet && hasExplicitRemoteStorage) ||
(isRemoteStorageExplicitlySet && hasExplicitDiskless)) {
throw new InvalidConfigurationException("remote.storage.enable cannot be set if diskless.enable is set to true.");
throw new InvalidConfigurationException("It is not valid to set a value for both diskless.enable and remote.storage.enable.");
}
}

Expand Down