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


##########
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:
   Don't want to complicate this. 
   
   If the RLMM plugin lists the remote log segments metadata in the previous 
invocation, then we can expect that the `maybeSeedHighestOffsetInRemoteStorage` 
to seed the highest remote offset. 



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