lianetm commented on code in PR #14357:
URL: https://github.com/apache/kafka/pull/14357#discussion_r1344406010


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AssignmentReconciler.java:
##########
@@ -44,21 +45,46 @@
 import java.util.stream.Collectors;
 
 /**
- * {@code MemberAssignmentReconciler} works with {@link MembershipManager} to 
first determine, and then modify the
- * current set of assigned {@link TopicPartition partitions} via {@link 
SubscriptionState}. Reconciliation is a
- * two-part process, the first being a revocation of partitions, followed by 
assignment of partitions. Each of the two
- * steps may result in one of the following:
+ * {@code AssignmentReconciler} performs the work of reconciling this 
consumer's partition assignment as directed
+ * by the consumer group coordinator. When the coordinator determines that a 
change to the partition ownership of
+ * the group is required, it will communicate with each consumer to relay its 
respective <em>target</em>
+ * assignment, that is, the set of partitions for which that consumer should 
now assume ownership. It is the then the
+ * responsibility of the consumer to work toward that target by performing the 
necessary internal modifications to
+ * satisfy the assignment from the coordinator. In practical terms, this means 
that it must first determine the set
+ * difference between the <em>{@link SubscriptionState#assignedPartitions() 
current assignment}</em> and the
+ * <em>{@link Assignment#assignedTopicPartitions() target assignment}</em>.
+ *
+ * <p/>
+ *
+ * Internally, reconciliation is a multi-step process:
+ *
+ * <ol>
+ *     <li>Calculating partitions to revoke</li>
+ *     <li>Invoking {@link 
ConsumerRebalanceListener#onPartitionsRevoked(Collection)}</li>

Review Comment:
   We need to commit offsets before revoking partitions if auto commit is 
enabled, I expect that should be here right? (interacting with the 
commitRequest manager)



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to