You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "chia7712 (via GitHub)" <gi...@apache.org> on 2026/08/06 15:29:05 UTC

Re: [PR] KAFKA-20609 : Use lastModified time as retention anchor for future-timestamped segments [kafka]

chia7712 commented on code in PR #22873:
URL: https://github.com/apache/kafka/pull/22873#discussion_r3730086524


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/UnifiedLog.java:
##########
@@ -2004,11 +2004,18 @@ private int deleteRetentionMsBreachedSegments() throws IOException {
         if (retentionMs < 0) return 0;
         long startMs = time().milliseconds();
 
+        boolean remoteLogEnabledAndRemoteCopyEnabled = remoteLogEnabledAndRemoteCopyEnabled();

Review Comment:
   Why cache `remoteLogEnabledAndRemoteCopyEnabled`? If it is necessary, should we do it earlier?



##########
storage/src/main/java/org/apache/kafka/storage/internals/log/UnifiedLog.java:
##########
@@ -2004,11 +2004,18 @@ private int deleteRetentionMsBreachedSegments() throws IOException {
         if (retentionMs < 0) return 0;
         long startMs = time().milliseconds();
 
+        boolean remoteLogEnabledAndRemoteCopyEnabled = remoteLogEnabledAndRemoteCopyEnabled();
         DeletionCondition shouldDelete = (segment, nextSegmentOpt) -> {
-            if (startMs < segment.largestTimestamp()) {
-                futureTimestampLogger.warn("{} contains future timestamp(s), making it ineligible to be deleted", segment);
+            long ageReferenceMs = segment.largestTimestamp();

Review Comment:
   +1 to `anchorTimestamp`



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

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