Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 98E988186 for ; Mon, 5 Sep 2011 17:48:32 +0000 (UTC) Received: (qmail 30617 invoked by uid 500); 5 Sep 2011 17:48:32 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 30572 invoked by uid 500); 5 Sep 2011 17:48:31 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 30556 invoked by uid 99); 5 Sep 2011 17:48:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Sep 2011 17:48:31 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Sep 2011 17:48:30 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D5C6459327 for ; Mon, 5 Sep 2011 17:48:09 +0000 (UTC) Date: Mon, 5 Sep 2011 17:48:09 +0000 (UTC) From: "Bryan Keller (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <748996297.17640.1315244889872.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1819670384.17638.1315244769883.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (HADOOP-7611) SequenceFile.Sorter creates local temp files on HDFS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-7611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Keller updated HADOOP-7611: --------------------------------- Description: When using SequenceFile.Sorter to sort or merge sequence files that exist in HDFS, it attempts to create temp files in a directory structure specified by mapred.local.dir but on HDFS, not in the local file system. The problem code is in MergeQueue.merge(). Starting at line 2953: {code} Path outputFile = lDirAlloc.getLocalPathForWrite( tmpFilename.toString(), approxOutputSize, conf); LOG.debug("writing intermediate results to " + outputFile); Writer writer = cloneFileAttributes( fs.makeQualified(segmentsToMerge.get(0).segmentPathName), fs.makeQualified(outputFile), null); {code} The outputFile here is a local path without a scheme, e.g. "/mnt/mnt1/mapred/local", specified by the mapred.local.dir property. If we are sorting files on HDFS, the fs object is a DistributedFileSystem. The call to fs.makeQualified(outputFile) appends the fs object's scheme to the local temp path returned by lDirAlloc, e.g. hdfs://mnt/mnt1/mapred/local. This directory is then created (if the proper permissions are available) on HDFS. If the HDFS permissions are not available, the sort/merge fails even though the directories exist locally. The code should instead always use the local file system if retrieving a path from the mapred.local.dir property. The unit tests do not test this condition, they only test using the local file system for sort and merge. was: When using SequenceFile.Sorter to sort or merge sequence files that exist in HDFS, it attempts to create temp files in a directory structure specified by mapred.local.dir but on HDFS, not in the local file system. The problem code is in MergeQueue.merge(). Starting at line 2953: {code} Path outputFile = lDirAlloc.getLocalPathForWrite( tmpFilename.toString(), approxOutputSize, conf); LOG.debug("writing intermediate results to " + outputFile); Writer writer = cloneFileAttributes( fs.makeQualified(segmentsToMerge.get(0).segmentPathName), fs.makeQualified(outputFile), null); {code} The outputFile here is a local path without a scheme, e.g. "/mnt/mnt1/mapred/local", specified by the mapred.local.dir property. If we are sorting files on HDFS, the fs object is a DistributedFileSystem. The call to fs.makeQualified(outputFile) appends the fs object's scheme to the local temp path returned by lDirAlloc, e.g. hdfs:///mnt/mnt1/mapred/local. This directory is then created (if the proper permissions are available) on HDFS. If the HDFS permissions are not available, the sort/merge fails even though the directories exist locally. The code should instead always use the local file system if retrieving a path from the mapred.local.dir property. The unit tests do not test this condition, they only test using the local file system for sort and merge. > SequenceFile.Sorter creates local temp files on HDFS > ---------------------------------------------------- > > Key: HADOOP-7611 > URL: https://issues.apache.org/jira/browse/HADOOP-7611 > Project: Hadoop Common > Issue Type: Bug > Components: io > Affects Versions: 0.20.2 > Environment: CentOS 5.6 64-bit, Oracle JDK 1.6.0_26 64-bit > Reporter: Bryan Keller > > When using SequenceFile.Sorter to sort or merge sequence files that exist in HDFS, it attempts to create temp files in a directory structure specified by mapred.local.dir but on HDFS, not in the local file system. The problem code is in MergeQueue.merge(). Starting at line 2953: > {code} > Path outputFile = lDirAlloc.getLocalPathForWrite( > tmpFilename.toString(), > approxOutputSize, conf); > LOG.debug("writing intermediate results to " + outputFile); > Writer writer = cloneFileAttributes( > fs.makeQualified(segmentsToMerge.get(0).segmentPathName), > fs.makeQualified(outputFile), null); > {code} > The outputFile here is a local path without a scheme, e.g. "/mnt/mnt1/mapred/local", specified by the mapred.local.dir property. If we are sorting files on HDFS, the fs object is a DistributedFileSystem. The call to fs.makeQualified(outputFile) appends the fs object's scheme to the local temp path returned by lDirAlloc, e.g. hdfs://mnt/mnt1/mapred/local. This directory is then created (if the proper permissions are available) on HDFS. If the HDFS permissions are not available, the sort/merge fails even though the directories exist locally. > The code should instead always use the local file system if retrieving a path from the mapred.local.dir property. The unit tests do not test this condition, they only test using the local file system for sort and merge. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira