Github user zsxwing commented on the issue:

    https://github.com/apache/spark/pull/15387
  
    > During the original implementation I had verified that calling pause 
kills the internal message buffer, which is one of the complications leading to 
a cached consumer per partition.
    
    I observed the same behavior during my debug. I found that the first 
`poll(0)` will always send a request to prefetch the data. Pausing partitions 
just prevents the second `poll(0)` from returning anything at here: 
https://github.com/apache/kafka/blob/0.10.0.1/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java#L527
    
    > You dont want poll consuming messages, its not just about offset
    correctness, the driver shouldnt be spending time or bandwidth doing that.
    
    I think you have agreed that this is impossible via current KafkaConsumer 
APIs as well.
    
    However, the unknown thing to me is that if the first `poll(0)` will return 
something. I saw the first `poll(0)` will always send the fetching request, but 
I'm not sure that if it's possible that the response will be processed in the 
first `poll(0)`. If this could happen, pausing partitions will not help in such 
case since it's called after the first `poll(0)`. In addition, since it's 
unclear in javadoc, it could be changed in the future. That's why I decided to 
manually seek to the beginning in #15397.
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to