-
Notifications
You must be signed in to change notification settings - Fork 14.8k
KAFKA-19074: Remove the cached responseData from ShareFetchResponse #19357
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
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.
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())); |
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.
If nonResponseData size is 0, the assertion for data inside it will not be executed. Do we still need this line? Thanks.
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.
Removed it, thanks!
| private static final int BATCH_SIZE = 500; | ||
|
|
||
| private final TopicIdPartition tidp0 = new TopicIdPartition(Uuid.randomUuid(), 0, "topic"); | ||
| private MemoryRecords records; |
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.
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?
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.
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.
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