Issue Details (XML | Word | Printable)

Key: HADOOP-4717
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Hairong Kuang
Reporter: Hairong Kuang
Votes: 0
Watchers: 1
Operations

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

Removal of default port# in NameNode.getUri() cause a map/reduce job failed to prompt temporay output

Created: 24/Nov/08 07:11 PM   Updated: 07/Aug/09 08:01 PM
Return to search
Component/s: None
Affects Version/s: 0.18.0
Fix Version/s: 0.18.3

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works HADOOP-4717.patch 2008-11-25 11:45 PM Doug Cutting 1 kB
Text File Licensed for inclusion in ASF works relativePath.patch 2008-12-04 01:29 AM Hairong Kuang 4 kB
Text File Licensed for inclusion in ASF works relativePath1.patch 2008-12-04 08:16 PM Hairong Kuang 4 kB
Issue Links:
Blocker
 
Reference
 

Hadoop Flags: Reviewed
Resolution Date: 05/Dec/08 08:00 PM


 Description  « Hide
Problem reported here is that when the default port number (8020) is specified in the output, job succeeds but no output is created. The cause of the problem is that "listStatus" call drops the port number because NameNode.getUri removes the default port#.

Assuming that a map/reduce output directory is set to be "hdfs://localhost:8020/out", A call "listStatus" on any of its sub directory, for example, "hdfs://localhost:8020/out/tempXX", returns results like below:

hdfs://localhost/out/tempXX/part-00005

Because of this, Task.java
574 private Path getFinalPath(Path jobOutputDir, Path taskOutput) {
575 URI relativePath = taskOutputPath.toUri().relativize(taskOutput.toUri());

does not get the correct relativePath because TaskOutputPath contain ports, but taskOutput doesn't.

It seems to me that the problem could be fixed if we make Path.makeQualified() to return the same path not matter the input path contains the default port or not.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Doug Cutting added a comment - 25/Nov/08 10:05 PM
It seems to me that the output directory should somewhere be normalized by calling FileSystem#makeQualified() on it, so that it's of the form "hdfs://localhost/out/".

Hairong Kuang added a comment - 25/Nov/08 10:56 PM
I wrote a test. It showed that FileSystem#makeQualified() did not remove the default port# even if the input path contains the default port #.

Doug Cutting added a comment - 25/Nov/08 11:45 PM
Here's a patch that changes DistributedFileSystem#makeQualified() to remove the default port if it's specified. Does that fix things for you?

Doug Cutting made changes - 25/Nov/08 11:45 PM
Field Original Value New Value
Attachment HADOOP-4717.patch [ 12394705 ]
Nigel Daley made changes - 01/Dec/08 07:13 PM
Priority Major [ 3 ] Blocker [ 1 ]
Nigel Daley made changes - 01/Dec/08 07:13 PM
Assignee Hairong Kuang [ hairong ]
Hairong Kuang made changes - 01/Dec/08 09:40 PM
Link This issue is blocked by HADOOP-4746 [ HADOOP-4746 ]
Hairong Kuang added a comment - 01/Dec/08 09:42 PM
Yes, it works as long as we also fix HADOOP-4746. Doug, could you please include a junit test?

Hairong Kuang made changes - 02/Dec/08 07:53 AM
Assignee Hairong Kuang [ hairong ] Doug Cutting [ cutting ]
Koji Noguchi added a comment - 03/Dec/08 04:45 PM
I understand that HADOOP-4717&HADOOP-4746 would fix the problem, but can we throw an Exception when
575 URI relativePath = taskOutputPath.toUri().relativize(taskOutput.toUri());

doesn't return a relativePath?
If we hit a similar issue again, I would rather have the job fail
than job returning 0 but silently deleting the output.


Hairong Kuang added a comment - 04/Dec/08 01:29 AM
In addition to Doug's change, this patch
1. throws IOException if relativitize fails as Koji suggested;
2. add a unit test to make sure a map/reduce job with output path containing no port works.

Hairong Kuang made changes - 04/Dec/08 01:29 AM
Attachment relativePath.patch [ 12395242 ]
Hairong Kuang added a comment - 04/Dec/08 08:16 PM
This new patch makes two changes in my newly added unit test:
1. When dfs cluster fails to start because of server binding exception, log the error and skip the test;
2. The map/reduce job has a output path that includes the default NameNode port#.

Hairong Kuang made changes - 04/Dec/08 08:16 PM
Attachment relativePath1.patch [ 12395320 ]
Doug Cutting added a comment - 04/Dec/08 09:03 PM
+1 This looks good to me.

Hairong Kuang added a comment - 05/Dec/08 01:31 AM
Ant test-core succeeded:
BUILD SUCCESSFUL
Total time: 113 minutes 54 seconds

Ant test-patch succeeded:
[exec] +1 overall.

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

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

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

[exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings.

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

[exec] +1 Eclipse classpath. The patch retains Eclipse classpath integrity.


Repository Revision Date User Message
ASF #723831 Fri Dec 05 19:26:25 UTC 2008 hairong HADOOP-4717. Removal of default port# in NameNode.getUri() causes a map/reduce job failed to prompt temporary output. Contributed by Hairong Kuang.
Files Changed
MODIFY /hadoop/core/trunk/CHANGES.txt
MODIFY /hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRWithDFS.java
MODIFY /hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
MODIFY /hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/FileOutputCommitter.java

Repository Revision Date User Message
ASF #723838 Fri Dec 05 19:57:58 UTC 2008 hairong Merge -r 723830:723831 from trunk to move the change log of HADOOP-4717 into branch 0.19
Files Changed
MODIFY /hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
MODIFY /hadoop/core/branches/branch-0.19/src/mapred/org/apache/hadoop/mapred/FileOutputCommitter.java
MODIFY /hadoop/core/branches/branch-0.19
MODIFY /hadoop/core/branches/branch-0.19/CHANGES.txt
MODIFY /hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/mapred/TestMiniMRWithDFS.java

Repository Revision Date User Message
ASF #723839 Fri Dec 05 20:00:09 UTC 2008 hairong Merge -r 723830:723831 from trunk to move the change log of HADOOP-4717 into branch 0.18
Files Changed
MODIFY /hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/mapred/TestMiniMRWithDFS.java
MODIFY /hadoop/core/branches/branch-0.18
MODIFY /hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DistributedFileSystem.java
MODIFY /hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/Task.java
MODIFY /hadoop/core/branches/branch-0.18/CHANGES.txt

Hairong Kuang added a comment - 05/Dec/08 08:00 PM
I've just committed this.

Hairong Kuang made changes - 05/Dec/08 08:00 PM
Resolution Fixed [ 1 ]
Assignee Doug Cutting [ cutting ] Hairong Kuang [ hairong ]
Hadoop Flags [Reviewed]
Status Open [ 1 ] Resolved [ 5 ]
Hudson added a comment - 06/Dec/08 02:02 PM

Nigel Daley made changes - 30/Jan/09 08:14 PM
Status Resolved [ 5 ] Closed [ 6 ]
Owen O'Malley made changes - 08/Jul/09 04:43 PM
Component/s dfs [ 12310710 ]
Koji Noguchi made changes - 07/Aug/09 08:01 PM
Link This issue relates to MAPREDUCE-837 [ MAPREDUCE-837 ]