dengziming commented on PR #9766:
URL: https://github.com/apache/kafka/pull/9766#issuecomment-2520313203

   Hi, @chia7712 , Thanks for noticing this PR, I have rebased on trunk and the 
test looks fine.
   
   We have a controversy here that in the past the length of 
`EndTransactionMarker` is hard-coded to 6, however it is dynamically acquired 
from it's serialized ByteBuffer, so I stored buffer of a `EndTransactionMarker` 
when it's created, this will add some state but reduce one calculation.
   
   Another alternative is to change `MemoryRecords.writeEndTransactionalMarker` 
signature to directly receive (xxx..., ByteBuffer markerBuffer, 
ControlRecordType markerType) as the below screenshot, but this involves more 
refactor, WDYT.
   
   
![image](https://github.com/user-attachments/assets/d50d28a5-226d-438c-b870-813c6b2edfa5)
   


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