Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDFS-17705. Improve datasetlock related log output. #7477

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public AutoCloseDataSetLock readLock(LockLevel level, String... resources) {
AutoCloseDataSetLock dirLock = getReadLock(level, resources);
dirLock.setParentLock(volLock);
if (openLockTrace) {
LOG.debug("Sub lock " + resources[0] + resources[1] + resources[2] + " parent lock " +
LOG.info("Sub lock " + resources[0] + resources[1] + resources[2] + " parent lock " +
resources[0] + resources[1]);
}
return dirLock;
Expand All @@ -206,7 +206,7 @@ public AutoCloseDataSetLock writeLock(LockLevel level, String... resources) {
AutoCloseDataSetLock dirLock = getWriteLock(level, resources);
dirLock.setParentLock(volLock);
if (openLockTrace) {
LOG.debug("Sub lock " + resources[0] + resources[1] + resources[2] + " parent lock " +
LOG.info("Sub lock " + resources[0] + resources[1] + resources[2] + " parent lock " +
resources[0] + resources[1]);
}
return dirLock;
Expand Down Expand Up @@ -273,6 +273,9 @@ public void addLock(LockLevel level, String... resources) {
new ReentrantReadWriteLock(isFair));
lockMap.addLock(lockName, new ReentrantReadWriteLock(isFair));
}
if (openLockTrace) {
LOG.info("Added {} lock, lock name: {}", level.name(), lockName);
}
}

@Override
Expand All @@ -281,6 +284,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ private synchronized void activateVolume(
List<String> allSubDirNameForDataSetLock = datasetSubLockStrategy.getAllSubLockNames();
for (String dir : allSubDirNameForDataSetLock) {
lockManager.addLock(LockLevel.DIR, bp, ref.getVolume().getStorageID(), dir);
LOG.info("Added DIR lock for bpid:{}, volume storageid:{}, dir:{}",
bp, ref.getVolume().getStorageID(), dir);
}
LOG.info("Added DIR lock for bpid:{}, volume storageid:{}.", bp,
ref.getVolume().getStorageID());
}
DatanodeStorage dnStorage = storageMap.get(sd.getStorageUuid());
if (dnStorage != null) {
Expand Down Expand Up @@ -3297,9 +3297,8 @@ public void addBlockPool(String bpid, Configuration conf)
List<String> allSubDirNameForDataSetLock = datasetSubLockStrategy.getAllSubLockNames();
for (String dir : allSubDirNameForDataSetLock) {
lockManager.addLock(LockLevel.DIR, bpid, v, dir);
LOG.info("Added DIR lock for bpid:{}, volume storageid:{}, dir:{}",
bpid, v, dir);
}
LOG.info("Added DIR lock for bpid:{}, volume storageid:{}.", bpid, v);
}
}
try {
Expand Down