Sammi Chen created HDDS-12919:
---------------------------------

             Summary: Remove FileLock from ChunkWrite
                 Key: HDDS-12919
                 URL: https://issues.apache.org/jira/browse/HDDS-12919
             Project: Apache Ozone
          Issue Type: Improvement
            Reporter: Sammi Chen
            Assignee: Sammi Chen


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. 

This task aims to remove the FileLock acquire for chunk write. 

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. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to