KAFKA-19074: Remove the cached responseData from ShareFetchResponse#19357
Merged
chia7712 merged 6 commits intoapache:trunkfrom Apr 5, 2025
Merged
KAFKA-19074: Remove the cached responseData from ShareFetchResponse#19357chia7712 merged 6 commits intoapache:trunkfrom
chia7712 merged 6 commits intoapache:trunkfrom
Conversation
Member
FrankYang0529
left a comment
There was a problem hiding this comment.
Overall LGTM. Leave a minor comment.
|
|
||
| LinkedHashMap<TopicIdPartition, ShareFetchResponseData.PartitionData> nonResponseData = shareFetch.responseData(Map.of()); | ||
| assertEquals(0, nonResponseData.size()); | ||
| nonResponseData.forEach((topicIdPartition, partitionData) -> assertEquals(MemoryRecords.EMPTY, partitionData.records())); |
Member
There was a problem hiding this comment.
If nonResponseData size is 0, the assertion for data inside it will not be executed. Do we still need this line? Thanks.
Collaborator
Author
There was a problem hiding this comment.
Removed it, thanks!
| private static final int BATCH_SIZE = 500; | ||
|
|
||
| private final TopicIdPartition tidp0 = new TopicIdPartition(Uuid.randomUuid(), 0, "topic"); | ||
| private MemoryRecords records; |
Member
There was a problem hiding this comment.
These two variables are only used in testDontCacheAnyData. Could we move them into the case, so we don't need to build records for each test case?
Collaborator
Author
There was a problem hiding this comment.
The original thought was we can leverage this variable in future like FetcherTest to add more tests but I am also fine to move this variable into method at the moment.
chia7712
approved these changes
Apr 5, 2025
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.
Jira: https://issues.apache.org/jira/browse/KAFKA-19074
Similar fix #16532
2b8aff5 make it accept input to return "partial" data.
The content of output is based on the input but we cache the output ...
It will return same output even though we pass different input. That is a potential bug.
Reviewers: PoAn Yang payang@apache.org, Chia-Ping Tsai chia7712@gmail.com