dybyte commented on code in PR #23569:
URL: https://github.com/apache/kafka/pull/23569#discussion_r4148184373


##########
core/src/main/java/kafka/server/TierStateMachine.java:
##########
@@ -243,20 +246,24 @@ private Long buildRemoteLogAuxState(TopicPartition 
topicPartition,
         // Assign nextOffset with the offset from which next fetch should 
happen.
         long nextOffset = remoteLogSegmentMetadata.endOffset() + 1;
 
-        // Truncate the existing local log before restoring the leader epoch 
cache and producer snapshots.
+        // Read everything needed from remote storage before modifying the 
local log, so that a failed read
+        // leaves the local log and its leader epoch cache untouched and the 
next fetch retries this state machine.
+        List<EpochEntry> epochs = readLeaderEpochCheckpoint(rlm, 
remoteLogSegmentMetadata);

Review Comment:
   I opened KAFKA-21192 for 2 and KAFKA-21191 for 3. The open questions are in 
KAFKA-21192.



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