Repository navigation
KAFKA-14414: Modify approach to calculate size of request header - #12917
Merged
Merged
Conversation
3 tasks
showuon
approved these changes
Nov 30, 2022
showuon
left a comment
Member
There was a problem hiding this comment.
LGTM! Thanks for the improvement.
Comment on lines
+132
to
+136
| // Size of header is calculated by the shift in the position of buffer's start position during parsing. | ||
| // Prior to parsing, the buffer's start position points to header data and after the parsing operation | ||
| // the buffer's start position points to api message. For more information on how the buffer is | ||
| // constructed, see RequestUtils#serialize() | ||
| header.size = Math.max(buffer.position() - bufferStartPositionForHeader, 0); |
honshu
added a commit
to confluentinc/kafka
that referenced
this pull request
Nov 30, 2022
* apache-kafka/trunk: (31 commits) KAFKA-14413: Separate MirrorMaker configurations for each connector (apache#12899) MINOR: Fix config documentation formatting (apache#12921) KAFKA-13731: Allow standalone workers to be started without providing any connector configurations (apache#11890) MINOR: Fix docs in security.html (apache#12851) MINOR: Remove config/kraft/README.md from rat exclusion list (apache#12923) MINOR: Update Gradle to 7.6 (apache#12918) KAFKA-14414: Fix request/response header size calculation (apache#12917) KAFKA-14339 : Do not perform producerCommit on serializationError when trying offsetWriter flush (apache#12920) KAFKA-14367; Add `JoinGroup` to the new `GroupCoordinator` interface (apache#12845) MINOR: buildoutput.log should be under the `build` directory (apache#12919) ...
guozhangwang
pushed a commit
to guozhangwang/kafka
that referenced
this pull request
Jan 25, 2023
Reviewers: Mickael Maison <[email protected]>, Luke Chen <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#12890 introduced the notion of calculating (and caching) the size for the request header during the first parse operation. This prevents re-calculation and hence, improves CPU usage for produce workload.
However, @showuon found a bug in calculation of size in that PR mentioned at #12916
This PR modifies the (incorrect!) approach we took earlier to calculate the header size and replaces it with another approach while still avoiding re-calculation of request header size.