showuon commented on code in PR #16653:
URL: https://github.com/apache/kafka/pull/16653#discussion_r1689235686


##########
storage/src/test/java/org/apache/kafka/tiered/storage/integration/DisableRemoteLogOnTopicTest.java:
##########
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.tiered.storage.integration;
+
+import org.apache.kafka.common.config.TopicConfig;
+import org.apache.kafka.tiered.storage.TieredStorageTestBuilder;
+import org.apache.kafka.tiered.storage.TieredStorageTestHarness;
+import org.apache.kafka.tiered.storage.specs.KeyValueSpec;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.apache.kafka.common.utils.Utils.mkEntry;
+import static org.apache.kafka.common.utils.Utils.mkMap;
+import static 
org.apache.kafka.server.log.remote.storage.LocalTieredStorageEvent.EventType.DELETE_SEGMENT;
+
+public final class DisableRemoteLogOnTopicTest extends 
TieredStorageTestHarness {
+
+    @Override
+    public int brokerCount() {
+        return 2;
+    }
+
+    @ParameterizedTest(name = "{displayName}.quorum={0}")
+    @ValueSource(strings = {"kraft"})
+    public void executeTieredStorageTest(String quorum) {
+        super.executeTieredStorageTest(quorum);
+    }
+
+    @Override
+    protected void writeTestSpecifications(TieredStorageTestBuilder builder) {

Review Comment:
   @clolov , for 
   > (a) we cannot access the data before the delete
   
   Do you mean the remote data got deleted (after disable.policy=delete), after 
re-enable the tiered storage, the remote data should not be readable? If so, I 
can add one later. 
   
   > b) archival + reading of latest archived data still works
   
   Do you mean after disable the tiered storage with "retain" policy, we should 
still be able to read the data from remote storage? If so, the existing test 
should cover this scenario in L79-86.
   
   ```
   // disable remote log storage
   .updateTopicConfig(topicA,
           
Collections.singletonMap(TopicConfig.REMOTE_LOG_STORAGE_ENABLE_CONFIG, "false"),
           Collections.emptyList())
   
   // make sure we can still consume from the beginning of the topic to read 
data from local and remote storage
   .expectFetchFromTieredStorage(broker0, topicA, p0, 2)
   .consume(topicA, p0, 0L, 3, 2)
   ```



-- 
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