m1a2st commented on code in PR #19702:
URL: https://github.com/apache/kafka/pull/19702#discussion_r2086240542


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LogConfig.java:
##########
@@ -561,10 +561,11 @@ public static void 
validateRemoteStorageOnlyIfSystemEnabled(Map<?, ?> props, boo
         }
     }
 
-    private static void validateNoRemoteStorageForCompactedTopic(Map<?, ?> 
props) {
-        String cleanupPolicy = 
props.get(TopicConfig.CLEANUP_POLICY_CONFIG).toString().toLowerCase(Locale.getDefault());
-        if (cleanupPolicy.contains(TopicConfig.CLEANUP_POLICY_COMPACT)) {
-            throw new ConfigException("Remote log storage is unsupported for 
the compacted topics");
+    @SuppressWarnings("unchecked")
+    private static void 
validateRemoteStorageRequiresDeleteCleanupPolicy(Map<?, ?> props) {
+        List<String> cleanupPolicy = (List<String>) 
props.get(TopicConfig.CLEANUP_POLICY_CONFIG);
+        if (cleanupPolicy.size() != 1 || 
!cleanupPolicy.get(0).toLowerCase(Locale.getDefault()).equals(TopicConfig.CLEANUP_POLICY_DELETE))
 {
+            throw new ConfigException("Remote log storage only supports topics 
with cleanup.policy=delete");

Review Comment:
   Could you also check the condition where the user might specify the delete 
condition multiple times?
   
   Ref: https://lists.apache.org/thread/vqk6rs23xbyy38x2tbohlz1pqnhkbonz
   



-- 
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-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to