ayushtkn commented on a change in pull request #2881:
URL: https://github.com/apache/hadoop/pull/2881#discussion_r618435518
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
##########
@@ -8575,22 +8587,21 @@ public void checkAndProvisionSnapshotTrashRoots() {
currDir += Path.SEPARATOR;
}
String trashPath = currDir + FileSystem.TRASH_PREFIX;
- HdfsFileStatus fileStatus = getFileInfo(trashPath, false, false,
false);
+ HdfsFileStatus fileStatus =
+ getFileInfo(trashPath, false, false, false);
if (fileStatus == null) {
- LOG.info("Trash doesn't exist for snapshottable directory {}. " +
"Creating trash at {}", currDir, trashPath);
+ LOG.info("Trash doesn't exist for snapshottable directory {}. "
+ + "Creating trash at {}", currDir, trashPath);
PermissionStatus permissionStatus =
new PermissionStatus(getRemoteUser().getShortUserName(), null,
SHARED_TRASH_PERMISSION);
mkdirs(trashPath, permissionStatus, false);
}
}
} catch (IOException e) {
- final String msg =
- "Could not provision Trash directory for existing "
- + "snapshottable directories. Exiting Namenode.";
- ExitUtil.terminate(1, msg);
+ LOG.error("Could not provision Trash directory for existing "
+ + "snapshottable directory", e);
Review comment:
Can you add the path as well in the log message.
Hope the Admin checks the logs after failover & restarts, and fixes things.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestHASafeMode.java
##########
@@ -98,6 +98,7 @@ public void setupCluster() throws Exception {
conf.setInt(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, BLOCK_SIZE);
conf.setInt(DFSConfigKeys.DFS_HEARTBEAT_INTERVAL_KEY, 1);
conf.setInt(DFSConfigKeys.DFS_HA_TAILEDITS_PERIOD_KEY, 1);
+ conf.setBoolean("dfs.namenode.snapshot.trashroot.enabled", false);
Review comment:
Can we move this config in `DFSConfigKyes` and use it from there, As of
now I think it is defined in `FsNamesystem` which doesn't makes, The value of
this I guess is exposed via getServerDefaults also so no point keeping it in
`FsN`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]