kamalcph commented on code in PR #22661:
URL: https://github.com/apache/kafka/pull/22661#discussion_r3503185936
##########
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:
> maybeSeedHighestOffsetInRemoteStorage
If this method does not seed the highest remote offset, then we may
encounter the same issue again. So, during restart if the RLMM plugin is not
ready, then `highestRemoteOffsetAndEpoch` can be (-1, -1). Good to handle this
case too.
--
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]