kamalcph commented on code in PR #16653: URL: https://github.com/apache/kafka/pull/16653#discussion_r1687406885
########## core/src/main/java/kafka/log/remote/RemoteLogManager.java: ########## @@ -482,19 +492,29 @@ public void stopPartitions(Set<StopPartition> stopPartitions, task.cancel(); return null; }); - leaderExpirationRLMTasks.computeIfPresent(tpId, (topicIdPartition, task) -> { - LOGGER.info("Cancelling the expiration RLM task for tpId: {}", tpId); - task.cancel(); - return null; - }); followerRLMTasks.computeIfPresent(tpId, (topicIdPartition, task) -> { LOGGER.info("Cancelling the follower RLM task for tpId: {}", tpId); task.cancel(); return null; }); + // here, we have to handle retain and delete separately. + // If "retain" is set, we should not cancel expiration task + if (!REMOTE_LOG_DISABLE_POLICY_RETAIN.equals(remoteLogDisablePolicy)) { + leaderExpirationRLMTasks.computeIfPresent(tpId, (topicIdPartition, task) -> { + LOGGER.info("Cancelling the expiration RLM task for tpId: {}", tpId); + task.cancel(); Review Comment: I was under the assumption that we will handle KAFKA-15313 together with this patch. https://github.com/apache/kafka/pull/13947#discussion_r1281675818 -- 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