kamalcph commented on code in PR #14652: URL: https://github.com/apache/kafka/pull/14652#discussion_r1398858656
########## core/src/main/java/kafka/server/ReplicaFetcherTierStateMachine.java: ########## @@ -238,12 +238,8 @@ private Long buildRemoteLogAuxState(TopicPartition topicPartition, log.debug("Updated the epoch cache from remote tier till offset: {} with size: {} for {}", leaderLocalLogStartOffset, epochs.size(), partition); - // Restore producer snapshot - File snapshotFile = LogFileUtils.producerSnapshotFile(unifiedLog.dir(), nextOffset); - buildProducerSnapshotFile(snapshotFile, remoteLogSegmentMetadata, rlm); - // Reload producer snapshots. - unifiedLog.producerStateManager().truncateFullyAndReloadSnapshots(); + truncateFullyAndReloadRestoredSnapshots(unifiedLog, nextOffset, remoteLogSegmentMetadata, rlm); Review Comment: Not sure when this case can happen in the leader-follower fetch protocol. We can keep the refactoring if required to maintain the code clarity. Can we update the title since this is not an issue? -- 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