chia7712 commented on pull request #6915:
URL: https://github.com/apache/kafka/pull/6915#issuecomment-625945043


   > fix this issue is to decouple the local log append from the purgatory 
checking. We can split ReplicaManager.appendRecords() into 2 methods: 
appendToLocal() and checkPurgatory(). We hold a group lock to call the former 
for serialization, but don't hold a group lock when calling the latter.
   
   This looks good to me that we should avoid the useless lock holding as much 
as possible. But, pardon me that I failed to catch the solution from your 
suggestion for this issue. If I understand correctly, this story is about the 
delayed produce can't be completed before timeout and the root cause is the 
group lock is held by another thread (in this case, the thread dealing with 
heartbeat request is holding the group lock). Hence, even if we don't hold the 
group lock when checking purgatory, the delayed produce created by 
```ReplicaManager#appendRecords``` still have chance to encounter this issue.
   
   please correct me if I misunderstand anything. 


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to