Skip to content

Conversation

jim0987795064
Copy link
Contributor

@jim0987795064 jim0987795064 commented Sep 7, 2025

  • Changes: Each append now writes to a new MemoryRecords batch instead of reusing a single batch object.

  • Reasons: If we reuse the same batch, its baseoffset will keep accumulating.

  • Performance demonstration:

original performance:
image
new performance:
image

There is no significant impact on performance after applying new method of writing info to log.

@github-actions github-actions bot added triage PRs from the community performance small Small PRs labels Sep 7, 2025
@jim0987795064 jim0987795064 changed the title (WIP)KAFKA-19614: The records appended to the log are illegal because of an incorrect base offset during TestLinearWriteSpeed KAFKA-19614: The records appended to the log are illegal because of an incorrect base offset during TestLinearWriteSpeed Sep 7, 2025
@jim0987795064 jim0987795064 changed the title KAFKA-19614: The records appended to the log are illegal because of an incorrect base offset during TestLinearWriteSpeed (WIP)KAFKA-19614: The records appended to the log are illegal because of an incorrect base offset during TestLinearWriteSpeed Sep 7, 2025
@jim0987795064 jim0987795064 changed the title (WIP)KAFKA-19614: The records appended to the log are illegal because of an incorrect base offset during TestLinearWriteSpeed KAFKA-19614: The records appended to the log are illegal because of an incorrect base offset during TestLinearWriteSpeed Sep 7, 2025
@chia7712
Copy link
Member

[ant:checkstyle] [ERROR] /home/chia7712/project/kafka/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/log/TestLinearWriteSpeed.java:65:5: NCSS for this method is 108 (max allowed is 100). [JavaNCSS]
[ant:checkstyle] [ERROR] /home/chia7712/project/kafka/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/log/TestLinearWriteSpeed.java:65:5: NPath Complexity is 720 (max allowed is 500). [NPathComplexity]
[ant:checkstyle] [ERROR] /home/chia7712/project/kafka/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/log/TestLinearWriteSpeed.java:65:5: Method main length is 171 lines (max allowed is 170). [MethodLength]

@github-actions github-actions bot removed the small Small PRs label Sep 12, 2025
Copy link

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants