kamalcph commented on code in PR #22661:
URL: https://github.com/apache/kafka/pull/22661#discussion_r3503337924


##########
storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java:
##########
@@ -1440,6 +1454,10 @@ void cleanupExpiredRemoteLogSegments() throws 
RemoteStorageException, ExecutionE
             // Build the leader epoch map by filtering the epochs that do not 
have any records.
             NavigableMap<Integer, Long> epochWithOffsets = 
buildFilteredLeaderEpochMap(leaderEpochCache.epochWithOffsets());
 
+            // Seed highestOffsetInRemoteStorage before size-retention to 
avoid the fresh-leader double-count
+            // (no-op once RLMCopyTask/RLMFollowerTask have seeded it).
+            maybeSeedHighestOffsetInRemoteStorage(log);

Review Comment:
   > we should rely on copiedOffsetOption (via 
leaderCopyRLMTasks.get(topicIdPartition)) 
   
   Got this approach. You were suggesting to use something like below in 
RLMExpirationTask. But, when the remote copy feature is disabled, then the 
RLMCopyTask won't be instantiated, so the current approach is good. 
   
   ```java
   ((RLMCopyTask) rlmCopyTask(topicIdPartition)).copiedOffsetOption;
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to