lianetm commented on code in PR #15271:
URL: https://github.com/apache/kafka/pull/15271#discussion_r1467829521
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImpl.java:
##########
@@ -674,6 +662,7 @@ void transitionToSendingLeaveGroup() {
ConsumerGroupHeartbeatRequest.LEAVE_GROUP_MEMBER_EPOCH;
updateMemberEpoch(leaveEpoch);
currentAssignment = new HashMap<>();
+ targetAssignmentReconciled =
currentAssignment.equals(currentTargetAssignment);
Review Comment:
I wonder if this could end up not being accurate in some case. Thinking
about a consumer RECONCILING, and then leaving the group while on it. Here we
would end up with `targetAssignmentReconciled` false, which is not accurate, as
the target is not relevant anymore and will be discarded when that delayed
reconciliation completes.
Is there a value in the `targetAssignmentReconciled` var other than caching
the sets comparison result? It definitely brings the challenge of making sure
we update it with the right value, in all the right places. Would it be safer
and simpler maybe just to keep the `targetAssignmentReconciled()` method,
checking current vs target when needed?
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImpl.java:
##########
@@ -208,22 +209,18 @@ public class MembershipManagerImpl implements
MembershipManager, ClusterResource
private final Map<Uuid, String> assignedTopicNamesCache;
/**
- * Topic IDs received in a target assignment for which we haven't found
topic names yet.
- * Items are added to this set every time a target assignment is received.
Items are removed
- * when metadata is found for the topic. This is where the member collects
all assignments
- * received from the broker, even though they may not be ready to
reconcile due to missing
+ * Topic IDs received in the last target assignment. Items are added to
this set every time a
Review Comment:
nit: Topic IDs "and partitions"...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]