showuon commented on code in PR #13561: URL: https://github.com/apache/kafka/pull/13561#discussion_r1181545427
########## core/src/main/scala/kafka/log/UnifiedLog.scala: ########## @@ -942,13 +974,19 @@ class UnifiedLog(@volatile var logStartOffset: Long, localLog.checkIfMemoryMappedBufferClosed() if (newLogStartOffset > logStartOffset) { - updatedLogStartOffset = true - updateLogStartOffset(newLogStartOffset) - _localLogStartOffset = newLogStartOffset - info(s"Incremented log start offset to $newLogStartOffset due to $reason") - leaderEpochCache.foreach(_.truncateFromStart(logStartOffset)) - producerStateManager.onLogStartOffsetIncremented(newLogStartOffset) - maybeIncrementFirstUnstableOffset() + _localLogStartOffset = math.max(newLogStartOffset, localLogStartOffset()) + // it should always get updated if tiered-storage is not enabled. + if (!onlyLocalLogStartOffsetUpdate || !remoteLogEnabled()) { + updatedLogStartOffset = true + updateLogStartOffset(newLogStartOffset) + _localLogStartOffset = newLogStartOffset Review Comment: It's confusing we update `_localLogStartOffset` twice with different value. I think the one in L982 should be removed, right? -- 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