My Oracle Support Banner

On Oracle Big Data Appliance Why Can an HDFS Directory be Deleted by a User who Belongs to Group when using the Trash Option (Doc ID 2061195.1)

Last updated on JANUARY 13, 2020

Applies to:

Big Data Appliance Integrated Software - Version 3.1.0 and later
Linux x86-64


NOTE: In the examples that follow, user details, cluster names, hostnames, directory paths, filenames, etc. represent a fictitious sample (and are used to provide an illustrative example only). Any similarity to actual persons, or entities, living or dead, is purely coincidental and not intended in any manner. 

On Oracle Big Data Appliance a directory can be deleted by user who belongs to the group.

For example, created an HDFS directory and file by 'hdfs' user in a directory owned by tuser:

bash-4.1$ touch /tmp/ktemp.txt
bash-4.1$ hdfs dfs -put /tmp/ktemp.txt /user/tuser/rtemp
bash-4.1$ hdfs dfs -ls /user/tuser
Found 2 items
drwxr-xr-x   - tuser tuser          0 2015-09-03 12:21 /user/tuser/.Trash
drwxr-xr-x   - hdfs  tuser          0 2015-09-03 13:23 /user/tuser/rtemp
bash-4.1$ hdfs dfs -ls /user/tuser/rtemp
Found 1 items
-rw-r--r--   3 hdfs tuser          0 2015-09-03 13:23 /user/tuser/rtemp/ktemp.txt

Then as tuser  tried to delete the directory without moving it to the .Trash directory first and this attempt failed. Then tried to move the file to the Trash (ie. equivalent to the 'hdfs dfs -rm ' command) and this operation succeeded.

--Directory  fails to get deleted with trash disabled
$ hdfs dfs -rm -r -skipTrash rtemp
rm: Permission denied: user=tuser, access=ALL, inode="/user/tuser/rtemp":hdfs:tuser:drwxr-xr-x

-- But directory gets deleted when trash is enabled
$ hdfs dfs -rm -r rtemp
15/09/03 13:29:20 INFO fs.TrashPolicyDefault: Namenode trash configuration: Deletion interval = 1440 minutes, Emptier interval = 0 minutes.
Moved: 'hdfs://<CLUSTER_NAME>-ns/user/tuser/rtemp' to trash at: hdfs://<CLUSTER_NAME>-ns/user/tuser/.Trash/Current



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.