DL1231 commented on code in PR #13947:
URL: https://github.com/apache/kafka/pull/13947#discussion_r1264591246


##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -556,6 +562,46 @@ public void copyLogSegmentsToRemote(UnifiedLog log) throws 
InterruptedException
             }
         }
 
+        public void cleanupDeletedRemoteLogSegments() {
+            if (isCancelled())
+                return;
+
+            Uuid topicId = topicIdPartition.topicId();
+            if (deletedTopicIds.contains(topicId)) {
+                cleanupAllRemoteLogSegments();
+                cancelRLMtask();
+                deletedTopicIds.remove(topicId);
+            }
+        }
+
+        private void cleanupAllRemoteLogSegments() {
+            if (!isLeader())

Review Comment:
   This is used to verify whether the current RLMTask is a leader, and the 
leaderEpoch information stored in RLMTask will not change after the topic is 
deleted.



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