rhauch commented on pull request #10112:
URL: https://github.com/apache/kafka/pull/10112#issuecomment-914547745


   @C0urante, thanks for the feedback on my suggestion. I like your option 3, 
because it does allow the iteration to stop on each source partition as soon as 
it encounters the first unacknowledged record in each queue. I also think that 
the behavior with the suggested approach and your option 3 is still a lot 
better than the current situation. 
   
   One question, though: you mention that it might be a problem if iterating 
over the submitted records takes longer than `offset.flush.timeout.ms`. But 
IIUC the `offset.flush.timeout.ms` would actually not be used anymore, as there 
actually are no timeouts as the offset commit thread doesn't block anymore. So, 
worst case, if task A has a ton of submitted records that have to be iterated 
over (e.g., fast producer and fast source task), it might slow the committing 
of offsets for other tasks. (Again, this is not any worse than the current 
behavior.) But your option 2 would help with this at the risk of using more 
threads, and so we may also want to consider this to help ensure that no 
slowly-proceeding producer of a task blocks other offset commits.
   
   Of course, another option might be to incur the iteration on the worker 
source task thread. That would essentially move the use of the queue(s) to the 
worker source task thread, tho we still need to get the offsets to the offset 
commit thread and so would likely have to keep the synchronization blocks 
around the offset writer snapshot. On one hand, that's putting more work onto 
the worker source task thread and making the offset thread super 
straightforward (snapshot and write); on the other it's putting the onus on the 
worker source task thread.
   
   Thoughts?


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