xijiu commented on PR #20669:
URL: https://github.com/apache/kafka/pull/20669#issuecomment-3385428587

   I think the cache should ideally only take effect in subscribe mode. This is 
because, in assign mode, apart from the current consumer being able to modify 
the offset of the corresponding TopicPartition, the Admin can also make 
modifications. Let’s assume such a scenario: the offset cached by the consumer 
is 10, and all subsequent requests to commit offset 10 will return successfully 
quickly without being sent to the broker. At this point, if the Admin is used 
to set the offset to 11, the consumer will not be aware of this change. As a 
result, the consumer caches an invalid offset, which is inconsistent with 
expectations.
   
   Additionally, although we could try to check if the cache is hit in manual 
commit mode, I feel that manual commit is an active user action, and it's 
better to send the request to the broker. Alternatively, we can consider adding 
cache support for manual commits later once this PR stabilizes.


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