KAFKA-20736: Improve removal of unassigned partitions from share sessions#22720
Open
AndrewJSchofield wants to merge 2 commits into
Open
KAFKA-20736: Improve removal of unassigned partitions from share sessions#22720AndrewJSchofield wants to merge 2 commits into
AndrewJSchofield wants to merge 2 commits into
Conversation
ShivsundarR
reviewed
Jul 1, 2026
| if (nodesWithPendingRequests.contains(node.id())) { | ||
| log.trace("Skipping fetch because previous fetch request to {} has not been processed", nodeId); | ||
| } else { | ||
| Set<TopicPartition> currentPartitionsToFetch = new HashSet<>(partitionsToFetch()); |
Contributor
There was a problem hiding this comment.
Is it possible to maybe include this logic the previous loop (the one processing the unsent acknowledgements) just after we do the acknowledgements check to avoid passing over the main map twice?
Since we are having the !handlerMap.containsKey(node) check here, it should not coincide with any partitions added in that acknowledgements loop pass.
Member
Author
There was a problem hiding this comment.
I thought about it, but the map is going to be small. I preferred having the logic separate of the third loop.
ShivsundarR
reviewed
Jul 1, 2026
ShivsundarR
left a comment
Contributor
There was a problem hiding this comment.
Thanks @AndrewJSchofield, looks good overall. Just a minor comment.
apoorvmittal10
approved these changes
Jul 1, 2026
apoorvmittal10
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the PR, LGTM!
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.
When all partitions in a share session are unassigned with no pending
acknowledgements to be sent, no ShareFetch request was being sent. This
patch sends a ShareFetch to remove the partitions from the share session
in this situation.
Reviewers: Shivsundar R shr@confluent.io, Apoorv Mittal
apoorvmittal10@gmail.com