ChenSammi opened a new pull request, #8435:
URL: https://github.com/apache/ozone/pull/8435

   ## What changes were proposed in this pull request?
   
   Remove the redundant FileLock during chunk write. 
   
   Currently before chunk read and write, it will acquire a read or write lock 
from fileStripedLock in ChunkUtils, so that read and write are welly controlled 
in Datanode.
   
   For chunk write, it further acquires an exclusive FileLock after acquire the 
write lock from fileStripedLock. As the FileLock mainly acts as inter-process 
lock purpose, to prevent another process from reading or writing to the same 
lock region, which is not a case in Ozone, there are no other processes which 
will read/write the same block file as Datanode. So acquire this exclusive 
FileLock after already holding the write lock from fileStripedLock is not 
necessary.
   
   BTW, it took ~2ms to acquire a FileLock, ~0.15ms to acquire a LOCK from 
fileStripedLock.
   And FileLock doesn't prevent file get deleted by another thread/process.
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-12919
   
   ## How was this patch tested?
   Existing unit tests
   


-- 
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: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to