feyman2016 commented on a change in pull request #9739:
URL: https://github.com/apache/kafka/pull/9739#discussion_r559082599



##########
File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java
##########
@@ -1477,6 +1477,7 @@ private void appendBatch(
     ) {
         try {
             int epoch = state.epoch();
+            batch.data.batches().forEach(recordBatch -> 
recordBatch.setPartitionLeaderEpoch(epoch));

Review comment:
       @hachikuji I thought the same as you, re-check the code, the 
`PARTITION_LEADER_EPOCH_OFFSET` has been set in 
`DefaultRecordBatch#writeHeader`, but the problem is that the `BatchBuilder` is 
always constructed with the `epoch=RecordBatch.NO_PARTITION_LEADER_EPOCH`, so I 
updated it and reverted the L1480.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to