You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "sunlishuo25 (via GitHub)" <gi...@apache.org> on 2026/10/03 09:04:48 UTC
[PR] MINOR: Drain buffered bytes before continuing delegated skips [kafka]
sunlishuo25 opened a new pull request, #23682:
URL: https://github.com/apache/kafka/pull/23682
When delegated `skip` returns zero, `ChunkedBytesStream.skip` reads through its own buffered `read()` method. That can fill the intermediate buffer, after which subsequent delegated skips move the source past unread buffered bytes. With input bytes 0–9 and a four-byte buffer, a source whose first skip returns zero makes `skip(5)` report success while the next read returns 1 instead of 5.
Consume any bytes prefetched by the fallback read before delegating another skip. This preserves the existing buffered codec path. The regression tests verify the full remaining sequence for skips within the buffer, beyond the buffer, and through EOF, plus repeated skips through real LZ4 frames containing consecutive empty compressed blocks.
Validation: compiled the actual production classes and the full `ChunkedBytesStreamTest` class with `javac --release 11` on JDK 21, then ran JUnit Jupiter 5.14.4 and Mockito 5.23.0. The unchanged production code fails 2 of 56 tests; the fix passes all 56. The three real LZ4 boundary cases also pass. File-scoped checks using Kafka's Checkstyle 12.3.1 configuration and Spotless 4.10.0 import-order step pass.
The LZ4 checks compile the current decoder and helper sources; a cached Kafka clients 3.9.2 jar supplies auxiliary compile-time signatures. They do not validate the complete current clients module or record batches. The official Gradle tasks, full clients suite, and CI JDKs 17/25 have not been run locally.
This is my original contribution, prepared with AI assistance from OpenAI Codex (GPT-6). I have the right to submit it and license it under the project's Apache-2.0 license.
Generated-by: OpenAI Codex (GPT-6)
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Drain buffered bytes before continuing delegated skips [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23682:
URL: https://github.com/apache/kafka/pull/23682#issuecomment-6183648919
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.
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org