HDFS-16785. Avoid to hold write lock to improve performance when add volume. (#4945). Contributed by ZanderXu.
Signed-off-by: Tao Li <tomscut@apache.org> Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
This commit is contained in:
parent
22c9f28f4d
commit
d3c1c453f0
|
@ -520,7 +520,7 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
|
|||
|
||||
for (final NamespaceInfo nsInfo : nsInfos) {
|
||||
String bpid = nsInfo.getBlockPoolID();
|
||||
try (AutoCloseDataSetLock l = lockManager.writeLock(LockLevel.BLOCK_POOl, bpid)) {
|
||||
try {
|
||||
fsVolume.addBlockPool(bpid, this.conf, this.timer);
|
||||
fsVolume.getVolumeMap(bpid, tempVolumeMap, ramDiskReplicaTracker);
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in New Issue