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

Colin Patrick McCabe commented on HDFS-10305:
---------------------------------------------

bq. That's interesting then. hdfs dfs -mkdir /dirAlreadyExists returns a 
non-zero return code. I assumed a non-zero error code == a failed operation. 
Obviously I was wrong.

A non-zero error code on the shell does indicate a failed operation.  You can 
see that FsShell explicitly checks to see whether the path exists and exits 
with an error code if so.  The code is in 
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Mkdir.java
  I don't think this has anything to do with what hdfs should put in the audit 
log, since in this case, FsShell doesn't even call mkdir.

> Hdfs audit shouldn't log mkdir operaton if the directory already exists.
> ------------------------------------------------------------------------
>
>                 Key: HDFS-10305
>                 URL: https://issues.apache.org/jira/browse/HDFS-10305
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>            Reporter: Rushabh S Shah
>            Assignee: Rushabh S Shah
>            Priority: Minor
>
> Currently Hdfs audit logs mkdir operation even if the directory already 
> exists.
> This creates confusion while analyzing audit logs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to