divijvaidya commented on code in PR #14649:
URL: https://github.com/apache/kafka/pull/14649#discussion_r1377446455


##########
core/src/main/scala/kafka/log/UnifiedLog.scala:
##########
@@ -1754,6 +1754,7 @@ class UnifiedLog(@volatile var logStartOffset: Long,
         leaderEpochCache.foreach(_.clearAndFlush())
         producerStateManager.truncateFullyAndStartAt(newOffset)
         logStartOffset = logStartOffsetOpt.getOrElse(newOffset)
+        if (remoteLogEnabled()) maybeIncrementLocalLogStartOffset(newOffset, 
LogStartOffsetIncrementReason.SegmentDeletion)

Review Comment:
   Is the reason segment deletion correct here? When an out of sync follower is 
catching up, it will truncate fully and start from beginning if the leader's 
local offset has moved past the followers local end offset. The leader's local 
offset could have moved past due to archival. 
   
   I would suggest to look at cases where this function is called and perhaps 
pass the reason from those here if there are multiple different ones OR you can 
use LeaderOffsetIncremented as the reason.



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

Reply via email to