apoorvmittal10 opened a new pull request, #19928:
URL: https://github.com/apache/kafka/pull/19928

   For ShareFetch Requests, the fetch happens through DelayedShareFetch 
operation. The operations which are already completed has reference to data 
being sent as response. As the operation is watched over multiple keys i.e. 
DelayedShareFetchGroupKey and DelayedShareFetchPartitionKey, hence if the 
operation can already be completed by either  watched key but the reference to 
the operation can still be present in other watched key. Which means the memory 
can only be free once purge operation is triggered by DelayedOperationPurgatory 
which removed the watched key operation from remaining keys, as the operation 
is already completed.
   
   The purge operation is dependent on the config 
`ShareGroupConfig#SHARE_FETCH_PURGATORY_PURGE_INTERVAL_REQUESTS_CONFIG` hence 
if the value is not smaller than the number of share fetch requests which can 
consume complete memory of the broker then broker can go out of memory. This 
can also be avoided by having lower fetch max bytes for request but this value 
is client dependent hence can't prevent the broker.
   
   This PR triggers the completion on both watched keys hence the 
DelayedShareFetch operation shall be removed from both keys which frees the 
broker memory as soon the share fetch response is sent. 


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