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


##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -461,6 +464,12 @@ public void onLeadershipChange(Set<Partition> 
partitionsBecomeLeader,
         }
     }
 
+    public void stopPartitions(Set<StopPartition> stopPartitions,
+                               BiConsumer<TopicPartition, Throwable> 
errorHandler) {
+        // null means remoteLogDisablePolicy is not applied
+        stopPartitions(stopPartitions, errorHandler, null);

Review Comment:
   I was thinking about it and tracing the callers of `stopPartitions`, I found 
we invoked it in different cases:
   1. stopReplica request
   2. stray logs handler
   3. apply topic image delta 
   4. `applyLocalFollowersDelta` when controller shutdown
   
   In different cases, we can't just expect they want to "retain" the remote 
logs. Like in "topic deletion" case, we expect all remote logs are deleted and 
all remote log tasks are cancelled (and we already did it). So we can't default 
them as "retain" or "delete" here, we need a "default" value here, that is not 
related to any `remoteLogDisablePolicy`. 
   
   Does that make sense?



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