Resolution: Not A Problem
Affects Version/s: 2.6.0
Fix Version/s: None
Suse 11 SP3
Name Quota and space quota is not verifying when setting a new value to a directory which already has subdirectories or contents.
Below are the steps to re-produce the cases:
Step-1) Create a New folder
hdfs dfs -mkdir /test
Step-2) Create sub folders
hdfs dfs -mkdir /test/one
hdfs dfs -mkdir /test/two
hdfs dfs -mkdir /test/three
Step-3) Set Name Quota as two
hdfs dfsadmin -setQuota 2 /test
Step-3) Quota will be set with out the validating the dirs
Eventhough name quota value is lower than the existing number of dirs, its not validating and allowing to set the new value.
Validate the name quota against the number of contents before setting the new value.
Step-1) Add any new folder or file , it will give error message
mkdir: The NameSpace quota (directories and files) of directory /test is exceeded: quota=2 file count=5
Step-2) Clear the Quota
hdfs dfsadmin -clrQuota /test
Step-3) Now Set the Size less than the folder size
hdfs dfsadmin -setSpaceQuota 10 /test
Eventhough space quota value is less than the size of the existing dir contents, its not validating and allowing to set the new value.
Validate the quota against the used space before setting the new value.