-
Notifications
You must be signed in to change notification settings - Fork 15.1k
KAFKA-16684: Remove cache in responseData #16532
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2884,6 +2884,11 @@ public void handleError(Throwable t) { | |
| verifySessionPartitions(); | ||
| handler.handleError(t); | ||
| } | ||
|
|
||
| @Override | ||
| public Map<Uuid, String> sessionTopicNames() { | ||
| return handler.sessionTopicNames(); | ||
| } | ||
|
|
||
| // Verify that session partitions can be traversed safely. | ||
| private void verifySessionPartitions() { | ||
|
|
@@ -3665,6 +3670,18 @@ public void testWhenFetchResponseReturnsALeaderShipChangeErrorAndNewLeaderInform | |
| // Validate subscription is still valid & fetch-able for tp1. | ||
| assertTrue(subscriptions.isFetchable(tp1)); | ||
| } | ||
|
|
||
| @Test | ||
| public void testFetcherDontCacheAnyData() { | ||
| short version = 17; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have any existing test where
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @apoorvmittal10, Thanks for your comments, In
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thansk for looking into, if there already exists a test then we can skip new one. |
||
| FetchResponse fetchResponse = fetchResponse(tidp0, records, Errors.NONE, 100L, -1L, 0L, 0); | ||
| LinkedHashMap<TopicPartition, FetchResponseData.PartitionData> responseData = fetchResponse.responseData(topicNames, version); | ||
| assertEquals(topicNames.size(), responseData.size()); | ||
| responseData.forEach((topicPartition, partitionData) -> assertEquals(records, partitionData.records())); | ||
| LinkedHashMap<TopicPartition, FetchResponseData.PartitionData> nonResponseData = fetchResponse.responseData(emptyMap(), version); | ||
| assertEquals(emptyMap().size(), nonResponseData.size()); | ||
| nonResponseData.forEach((topicPartition, partitionData) -> assertEquals(MemoryRecords.EMPTY, partitionData.records())); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is never executed. We can remove this assertion.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice find
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can also replace
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've opened a minor PR #19376 to remove it. Thanks @FrankYang0529 for pointing it out! |
||
| } | ||
|
|
||
| private OffsetsForLeaderEpochResponse prepareOffsetsForLeaderEpochResponse( | ||
| TopicPartition topicPartition, | ||
|
|
||
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.
This part is good but it's gone too far. Maybe we can create a
FetchResponseand then test the methodresponseData?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.
Yes, I will simplify this test