@hzxa21 I originally thought you suggested to always get a read/write lock when 
reading/writing the log. Then RequestHandlerThread also needs to get the 
read/write lock when handling FetchRequest/ProduceRequest. This adds two more 
cases to the list provided above. It seems a bit weird to get the read lock 
when log cleaner reads segment but not when the RequestHandlerThread reads log.

In terms of design it seems that we agree to keep the log read operation lock 
free for performance reason. In terms of implementation it seems that there is 
currently no known bug due to the way Kafka accesses the log. It is hard to 
comment on whether we should add more semantics without knowing what is that 
semantics. I am personally OK with the current way we use 
`abortAndPauseCleaning` and `resumeCleaning`. If there is better way to handle 
this that is less error-prone without degrading performance, we can discuss 
more when there is PR.



[ Full content available at: https://github.com/apache/kafka/pull/5591 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to