smengcl opened a new pull request #2352: URL: https://github.com/apache/hadoop/pull/2352
https://issues.apache.org/jira/browse/HDFS-15607 ## Changes - Snapshottable directory trash root will be automatically provisioned (with permission 777 and sticky bit) when allowing snapshot via DFSAdmin command, if `dfs.namenode.snapshot.trashroot.enabled` is set to `true` on the NameNode. ``` $ hdfs dfsadmin -allowSnapshot /ssdir3/ Allowing snapshot on /ssdir3/ succeeded $ hdfs dfs -ls /ssdir3 Found 1 items drwxrwxrwt - smeng supergroup 0 2020-09-30 00:00 /ssdir3/.Trash ``` - `DistributedFileSystem#allowSnapshot` does NOT provision trash root at all. This behavior is intentionally kept aligned with `DistributedFileSystem#createEncryptionZone`. - Added new dfsadmin command `-provisionSnapshotTrash`. Admins can use this new command to provision trash roots when the cluster is upgraded from older HDFS which doesn't have snapshottable directory trash roots feature: ``` $ hdfs dfsadmin -provisionSnapshotTrash Usage: hdfs dfsadmin [-provisionSnapshotTrash <snapshotDir>] $ hdfs dfsadmin -provisionSnapshotTrash /ssdir2/ Provision of snapshot trash in /ssdir2/ succeeded $ hdfs dfs -ls /ssdir2/ Found 1 items drwxrwxrwt - smeng supergroup 0 2020-09-30 00:00 /ssdir2/.Trash ``` - Added test in `TestDistributedFileSystem`. ---------------------------------------------------------------- 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]
