[ 
https://issues.apache.org/jira/browse/HDFS-14505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17075246#comment-17075246
 ] 

Ayush Saxena edited comment on HDFS-14505 at 4/4/20, 6:56 PM:
--------------------------------------------------------------

Well honestly, I didn't understand the fix itself. 
how is quota being ensured that it wont get violated post create. and moreover 
quota should be checked once only, if it is checked before during delete 
itself, it shouldn't be checked in that case later...
What happens for normal file if it is of non zero size, and storage space quota 
gets violated, still the old file gets deleted. Or if file create fails due to 
some other reason rather than quota post delete, We can’t prevent in that case. 
Isn’t Overwrite tend to behave like that?


was (Author: ayushtkn):
Well honestly, I didn't understand the fix itself. 
how is quota being ensured that it wont get violated post create? There is 
mkdir for the parent too, if the parent doesn't exist and moreover quota should 
be checked once only, if it is checked before during delete itself, it 
shouldn't be checked in that case later...

> "touchz" command should check quota limit before deleting an already existing 
> file
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-14505
>                 URL: https://issues.apache.org/jira/browse/HDFS-14505
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Shashikant Banerjee
>            Assignee: hemanthboyina
>            Priority: Major
>         Attachments: HDFS-14505.001.patch
>
>
> {code:java}
> HW15685:bin sbanerjee$ ./hdfs dfs -ls /dir2
> 2019-05-21 15:14:01,080 WARN util.NativeCodeLoader: Unable to load 
> native-hadoop library for your platform... using builtin-java classes where 
> applicable
> Found 1 items
> -rw-r--r--   1 sbanerjee hadoop          0 2019-05-21 15:10 /dir2/file4
> HW15685:bin sbanerjee$ ./hdfs dfs -touchz /dir2/file4
> 2019-05-21 15:14:12,247 WARN util.NativeCodeLoader: Unable to load 
> native-hadoop library for your platform... using builtin-java classes where 
> applicable
> touchz: The NameSpace quota (directories and files) of directory /dir2 is 
> exceeded: quota=3 file count=5
> HW15685:bin sbanerjee$ ./hdfs dfs -ls /dir2
> 2019-05-21 15:14:20,607 WARN util.NativeCodeLoader: Unable to load 
> native-hadoop library for your platform... using builtin-java classes where 
> applicable
> {code}
> Here, the "touchz" command failed to create the file as the quota limit was 
> hit, but ended up deleting the original file which existed. It should do the 
> quota check before deleting the file so that after successful deletion, 
> creation should succeed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to