guozhangwang commented on a change in pull request #11340:
URL: https://github.com/apache/kafka/pull/11340#discussion_r728349026



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
##########
@@ -994,11 +996,16 @@ public boolean commitOffsetsSync(Map<TopicPartition, 
OffsetAndMetadata> offsets,
         if (offsets.isEmpty())
             return true;
 
+        boolean shouldCleanUpConsumedOffsets = 
!checkConsumedOffsetsAreValid(offsets);

Review comment:
       > To add, I think it is necessary to automatically clean up non-existent 
offsets in the `onJoinPrepare` method
   
   I would not worry too much about `poll(long)` since 1) it is already 
deprecated since 2.0 and would be removed soon, and the main reason is indeed 
that it's, by design, going to block forever for metadata refresh / auto 
committing.
   
   > I think if you pass waitOnMetadata to ensureActiveGroup, it will make 
things more complicated
   
   I agree it would be more complicated at the moment, but once we remove the 
deprecated `poll(long)` API we would be able to simplify that logic since we 
would not need `waitOnMetadata` any more.




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