chickenchickenlove commented on code in PR #24250:
URL: https://github.com/apache/kafka/pull/24250#discussion_r4667207059


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java:
##########
@@ -1162,23 +1231,32 @@ private void maybeReconcile() {
                 "current assignment.");
             return;
         }
-        if (reconciliationInProgress) {
+
+        if (isReconciliationInProgress()) {
             log.trace("Ignoring reconciliation attempt. Another reconciliation 
is already in progress. Assignment {}" +
                 " will be handled in the next reconciliation loop.", 
targetAssignment);
             return;
         }
 
+        if (isPartialAssignmentReconciled() && (metadata.updateVersion() == 
lastReconciledMetadataVersion)) {
+            metadata.requestUpdate(true);
+            return;
+        }
+
         markReconciliationInProgress();
 
-        SortedSet<StreamsRebalanceData.TaskId> assignedActiveTasks = 
toTaskIdSet(targetAssignment.activeTasks);
-        SortedSet<StreamsRebalanceData.TaskId> ownedActiveTasks = 
toTaskIdSet(currentAssignment.activeTasks);
+        final LocalAssignment assignmentToReconcile = reconcilingAssignment;
+        final LocalAssignment previouslyAssignedAssignment = currentAssignment;
+
+        SortedSet<StreamsRebalanceData.TaskId> assignedActiveTasks = 
toTaskIdSet(assignmentToReconcile.activeTasks);
+        SortedSet<StreamsRebalanceData.TaskId> ownedActiveTasks = 
toTaskIdSet(previouslyAssignedAssignment.activeTasks);

Review Comment:
   Yes, duplicate revocation is possible here. This behavior predates the PR. 
The first revision tracked successful revocations in `revokedTasksSinceApply`, 
but we removed that tracking to keep the backport focused.



-- 
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]

Reply via email to