Skip to content

Commit 263a5ca

Browse files
committed
checkAndUpdate use subdir lock
1 parent 4751846 commit 263a5ca

File tree

1 file changed

+2
-1
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl

1 file changed

+2
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2774,7 +2774,8 @@ public void checkAndUpdate(String bpid, ScanInfo scanInfo)
27742774
lastDirScannerNotifyTime = startTimeMs;
27752775
}
27762776
String storageUuid = vol.getStorageID();
2777-
try (AutoCloseableLock lock = lockManager.writeLock(LockLevel.VOLUME, bpid, storageUuid)) {
2777+
try (AutoCloseableLock lock = lockManager.writeLock(LockLevel.DIR, bpid,
2778+
vol.getStorageID(), DatanodeUtil.idToBlockDirSuffixName(blockId))) {
27782779
if (!storageMap.containsKey(storageUuid)) {
27792780
// Storage was already removed
27802781
return;

0 commit comments

Comments
 (0)