From faf07456c59ae1a84432d39529aad9c18ab0daf0 Mon Sep 17 00:00:00 2001 From: huangzhaobo Date: Sat, 4 Jan 2025 16:21:34 +0800 Subject: [PATCH] improve remove lock log --- .../apache/hadoop/hdfs/server/datanode/DataSetLockManager.java | 3 +++ .../hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataSetLockManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataSetLockManager.java index 91a592a872c000..576959c2af3aff 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataSetLockManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataSetLockManager.java @@ -273,6 +273,9 @@ public void removeLock(LockLevel level, String... resources) { try (AutoCloseDataSetLock lock = writeLock(level, resources)) { lockMap.removeLock(lockName); } + if (openLockTrace) { + LOG.info("Removed {} lock, lock name: {}", level.name(), lockName); + } } @Override diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java index 69dc639f49e9e3..a5c0082abefbc9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java @@ -645,8 +645,6 @@ public void removeVolumes( List allSubDirNameForDataSetLock = datasetSubLockStrategy.getAllSubLockName(); for (String dir : allSubDirNameForDataSetLock) { lockManager.removeLock(LockLevel.DIR, bp, storageUuid, dir); - LOG.info("Removed DIR lock for bpid:{}, volume storageid:{}, dir:{}", - bp, storageUuid, dir); } lockManager.removeLock(LockLevel.VOLUME, bp, storageUuid); }