HDFS-16855. Remove the redundant write lock in addBlockPool. Contributed by DingShun.

This commit is contained in:
shun01.ding 2022-11-28 21:19:10 +08:00
parent 1a7acc403b
commit 54a0786d10
1 changed files with 9 additions and 11 deletions

View File

@ -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) {