-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KAFKA-18522: Slice records for share fetch #18804
base: trunk
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 9 changed files in this pull request and generated 1 comment.
Files not reviewed (4)
- gradle/spotbugs-exclude.xml: Language not supported
- core/src/test/java/kafka/server/share/ShareFetchUtilsTest.java: Evaluated as low risk
- core/src/test/java/kafka/server/share/SharePartitionManagerTest.java: Evaluated as low risk
- core/src/test/java/kafka/server/share/DelayedShareFetchTest.java: Evaluated as low risk
Comments suppressed due to low confidence (3)
core/src/test/java/kafka/server/share/SharePartitionTest.java:5898
- Consider overloading the fetchAcquiredRecords method instead of adding a boolean flag for subsetAcquired.
private List<AcquiredRecords> fetchAcquiredRecords(
core/src/test/java/kafka/server/share/SharePartitionTest.java:5914
- Ensure that the memoryRecordsBuilder method from ShareFetchTestUtils is used consistently across all tests.
return memoryRecordsBuilder(numOfRecords, startOffset).build();
server/src/main/java/org/apache/kafka/server/share/fetch/ShareAcquiredRecords.java:45
- Ensure that the subsetAcquired flag is properly tested to verify the slicing logic works correctly when this flag is true or false.
private final boolean subsetAcquired;
server/src/main/java/org/apache/kafka/server/share/fetch/ShareAcquiredRecords.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 9 changed files in this pull request and generated 1 comment.
Files not reviewed (4)
- gradle/spotbugs-exclude.xml: Language not supported
- core/src/main/java/kafka/server/share/ShareFetchUtils.java: Evaluated as low risk
- core/src/main/java/kafka/server/share/SharePartition.java: Evaluated as low risk
- core/src/test/java/kafka/server/share/DelayedShareFetchTest.java: Evaluated as low risk
The PR handles slicing of fetched records based on acquire response for share fetch. There could be additional bytes fetched from log but acquired offsets can be a subset, typically with
max fetch records
configuration. Rather sending additional bytes of fetched data to client we should slice the file and wire only needed batches.Note: If the acquired offsets are within a batch then we need to send the entire batch within the file record. Hence rather checking for inidividual batches, PR finds the first and last acquired offset, and trims the file for all batches between (inclusive) these two offsets.