chickenchickenlove commented on code in PR #24250:
URL: https://github.com/apache/kafka/pull/24250#discussion_r4667109384
##########
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;
Review Comment:
This is a valid point. The initial commit
63bb20df892dc0b000f6f23b9a4d312a43581f97 tracked that state separately as well.
However, to make backporting easier, we decided to minimize the amount of
state we track separately. As a result, we decided not to handle the case where
the assignment has been applied to ConsumerSubscriptionState but the callback
fails. In particular, since a callback failure usually leads the application
thread to shut down the Streams application, we concluded that we do not need
to track that state separately for now.
--
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]