Issue Details (XML | Word | Printable)

Key: HADOOP-2193
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mahadev konar
Reporter: Mukund Madhugiri
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

dfs rm and rmr commands differ from POSIX standards

Created: 12/Nov/07 07:08 PM   Updated: 08/Jul/09 04:42 PM
Component/s: None
Affects Version/s: 0.15.1, 0.16.0
Fix Version/s: 0.17.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works HADOOP-2193-1.patch 2007-11-19 08:03 PM Lohit Vijayarenu 2 kB
Text File Licensed for inclusion in ASF works hadoop_2193_1.patch 2008-02-11 11:55 PM Mahadev konar 3 kB
Text File Licensed for inclusion in ASF works hadoop_2193_2.patch 2008-02-12 12:53 AM Mahadev konar 2 kB
Text File Licensed for inclusion in ASF works hadoop_2193_3.patch 2008-02-12 01:59 AM Mahadev konar 2 kB
Text File Licensed for inclusion in ASF works hadoop_2193_4.patch 2008-02-12 02:05 AM Mahadev konar 2 kB
Issue Links:
Dependants
 

Resolution Date: 12/Feb/08 06:43 AM


 Description  « Hide
Assuming the dfs commands follow POSIX standards, there are some problems with the DFS rm and rmr commands. I compared the DFS output with that of RHEL 4u5:

In both cases, if the file/directory does not exist, it will not give any indication to the user.

1. rm a file/directory that does not exist:
Linux: rm: cannot remove `testarea/two': No such file or directory
DFS: rm: /testarea/two

2. rmr a file/directory that does not exist:
Linux: rm: cannot remove `testarea/two': No such file or directory
DFS: rm: /testarea/two



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Lohit Vijayarenu added a comment - 19/Nov/07 08:03 PM
Attached is a simple patch. Since fs.delete does not propagate FileNotFoundException, I have added a fs.exists() check even before we try to move to trash and attempt delete. updated testcase to verify this.

Mahadev konar added a comment - 11/Feb/08 11:55 PM
this patch fixes the issue.

with dfs -rm[-r] /nonexistentfile
this prints
cannot remove /nonexistentfile: No such file or directory.

the patch on a fs.delete returning false checks if the file does not exist. (this is just to save rpcs on a exists for every case) and then throws filenotfoundexcpetion.


Lohit Vijayarenu added a comment - 12/Feb/08 12:11 AM
+1 re-throwing FileNotFound seems better.

Mahadev konar added a comment - 12/Feb/08 12:53 AM
this patch removes some redundant code...

Hadoop QA added a comment - 12/Feb/08 01:43 AM
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12375281/hadoop_2193_1.patch
against trunk revision 619744.

@author +1. The patch does not contain any @author tags.

tests included +1. The patch appears to include 3 new or modified tests.

javadoc +1. The javadoc tool did not generate any warning messages.

javac +1. The applied patch does not generate any new javac compiler warnings.

release audit +1. The applied patch does not generate any new release audit warnings.

findbugs +1. The patch does not introduce any new Findbugs warnings.

core tests +1. The patch passed core unit tests.

contrib tests +1. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1777/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1777/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1777/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1777/console

This message is automatically generated.


Mahadev konar added a comment - 12/Feb/08 01:59 AM
removed tabs and empty spaces.

Mahadev konar added a comment - 12/Feb/08 02:05 AM
accidentally added a bracket in the last one

Hadoop QA added a comment - 12/Feb/08 05:22 AM
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12375300/hadoop_2193_4.patch
against trunk revision 619744.

@author +1. The patch does not contain any @author tags.

tests included +1. The patch appears to include 3 new or modified tests.

javadoc +1. The javadoc tool did not generate any warning messages.

javac +1. The applied patch does not generate any new javac compiler warnings.

release audit +1. The applied patch does not generate any new release audit warnings.

findbugs +1. The patch does not introduce any new Findbugs warnings.

core tests +1. The patch passed core unit tests.

contrib tests +1. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1780/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1780/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1780/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/1780/console

This message is automatically generated.


Raghu Angadi added a comment - 12/Feb/08 06:43 AM
I just committed this. Thanks Mahadev.

Hudson added a comment - 12/Feb/08 12:10 PM