Details
Description
Now we have HDFS-15150, we can start to move some DN operations to use the read lock rather than the write lock to improve concurrence. The first step is to make the changes to ReplicaMap, as many other methods make calls to it.
This Jira switches read operations against the volume map to use the readLock rather than the write lock.
Additionally, some methods make a call to replicaMap.replicas() (eg getBlockReports, getFinalizedBlocks, deepCopyReplica) and only use the result in a read only fashion, so they can also be switched to using a readLock.
Next is the directory scanner and disk balancer, which only require a read lock.
Finally (for this Jira) are various "low hanging fruit" items in BlockSender and fsdatasetImpl where is it fairly obvious they only need a read lock.
For now, I have avoided changing anything which looks too risky, as I think its better to do any larger refactoring or risky changes each in their own Jira.
Attachments
Attachments
Issue Links
- causes
-
HDFS-15457 TestFsDatasetImpl fails intermittently
- Resolved
-
HDFS-15818 Fix TestFsDatasetImpl.testReadLockCanBeDisabledByConfig
- Resolved
- Dependent
-
HDFS-15180 DataNode FsDatasetImpl Fine-Grained Locking via BlockPool.
- Resolved
- is related to
-
HDFS-15150 Introduce read write lock to Datanode
- Resolved
- relates to
-
HDFS-15415 Reduce locking in Datanode DirectoryScanner
- Resolved
-
HDFS-15000 Improve FsDatasetImpl to avoid IO operation in datasetLock
- Patch Available
- links to