chia7712 commented on code in PR #18089:
URL: https://github.com/apache/kafka/pull/18089#discussion_r1880221790


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:
##########
@@ -1175,21 +1175,8 @@ private CompletableFuture<Void> assignPartitions(
 
         // Invoke user call back.
         CompletableFuture<Void> result = 
signalPartitionsAssigned(addedPartitions);
-        result.whenComplete((__, exception) -> {
-            if (exception == null) {
-                // Enable newly added partitions to start fetching and 
updating positions for them.
-                
subscriptions.enablePartitionsAwaitingCallback(addedPartitions);
-            } else {
-                // Keeping newly added partitions as non-fetchable after the 
callback failure.
-                // They will be retried on the next reconciliation loop, until 
it succeeds or the
-                // broker removes them from the assignment.
-                if (!addedPartitions.isEmpty()) {
-                    log.warn("Leaving newly assigned partitions {} marked as 
non-fetchable and not " +
-                            "requiring initializing positions after 
onPartitionsAssigned callback failed.",
-                        addedPartitions, exception);
-                }
-            }
-        });
+        // Enable newly added partitions to start fetching and updating 
positions for them.
+        result.whenComplete((__, exception) -> 
subscriptions.enablePartitionsAwaitingCallback(addedPartitions));

Review Comment:
   > then isn't the bug still on the recovery (meaning, re-enabling the 
partitions that were awaiting callbacks)?
   
   Introducing the new concept of "recovery" presents another issue: 
identifying which partitions are currently undergoing recovery. For example, 
some callbacks might process some partitions successfully, so it is hard to 
pass "recovery" partitions to the correct callbacks. Additionally, according to 
the 
[documentation](https://github.com/apache/kafka/blob/7591868aead54fff7d5e8a44c5e06746ed34866b/clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRebalanceListener.java#L87),
 we may already define the behavior of the callback.
   
   However, I agree that the current behavior appears to be a bug, but 
addressing it may require a KIP (or further discussion) to define the new 
behavior of the callback in handling exceptions. For now, this PR can focus on 
fixing the inconsistent behavior.
   



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