HDFS-16855. Remove the redundant write lock in addBlockPool. Contributed by DingShun.
This commit is contained in:
parent
1a7acc403b
commit
54a0786d10
|
@ -3187,7 +3187,6 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
LOG.info("Adding block pool " + bpid);
|
LOG.info("Adding block pool " + bpid);
|
||||||
AddBlockPoolException volumeExceptions = new AddBlockPoolException();
|
AddBlockPoolException volumeExceptions = new AddBlockPoolException();
|
||||||
try (AutoCloseableLock lock = lockManager.writeLock(LockLevel.BLOCK_POOl, bpid)) {
|
|
||||||
try {
|
try {
|
||||||
volumes.addBlockPool(bpid, conf);
|
volumes.addBlockPool(bpid, conf);
|
||||||
} catch (AddBlockPoolException e) {
|
} catch (AddBlockPoolException e) {
|
||||||
|
@ -3198,7 +3197,6 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
|
||||||
for (String v : vols) {
|
for (String v : vols) {
|
||||||
lockManager.addLock(LockLevel.VOLUME, bpid, v);
|
lockManager.addLock(LockLevel.VOLUME, bpid, v);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
volumes.getAllVolumesMap(bpid, volumeMap, ramDiskReplicaTracker);
|
volumes.getAllVolumesMap(bpid, volumeMap, ramDiskReplicaTracker);
|
||||||
} catch (AddBlockPoolException e) {
|
} catch (AddBlockPoolException e) {
|
||||||
|
|
Loading…
Reference in New Issue