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 D33BF10C4E for ; Thu, 25 Jul 2013 23:11:49 +0000 (UTC) Received: (qmail 88366 invoked by uid 500); 25 Jul 2013 23:11:49 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 88315 invoked by uid 500); 25 Jul 2013 23:11:49 -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 88237 invoked by uid 99); 25 Jul 2013 23:11:49 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 23:11:49 +0000 Date: Thu, 25 Jul 2013 23:11:49 +0000 (UTC) From: "Chris Nauroth (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-9507) LocalFileSystem rename() is broken in some cases when destination exists 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-9507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chris Nauroth updated HADOOP-9507: ---------------------------------- Attachment: HADOOP-9507-branch-1.4.patch HADOOP-9507-branch-1-win.4.patch > LocalFileSystem rename() is broken in some cases when destination exists > ------------------------------------------------------------------------ > > Key: HADOOP-9507 > URL: https://issues.apache.org/jira/browse/HADOOP-9507 > Project: Hadoop Common > Issue Type: Bug > Components: fs > Affects Versions: 3.0.0, 1-win, 2.1.0-beta, 1.3.0 > Reporter: Mostafa Elhemali > Assignee: Chris Nauroth > Priority: Minor > Attachments: HADOOP-9507-branch-1.1.patch, HADOOP-9507-branch-1.3.patch, HADOOP-9507-branch-1.4.patch, HADOOP-9507-branch-1-win.1.patch, HADOOP-9507-branch-1-win.3.patch, HADOOP-9507-branch-1-win.4.patch, HADOOP-9507.branch-1-win.patch, HADOOP-9507-trunk.1.patch, HADOOP-9507-trunk.2.patch, HADOOP-9507-trunk.3.patch > > > The rename() method in RawLocalFileSystem uses FileUtil.copy() without realizing that FileUtil.copy() has a special behavior that if you're copying /foo to /bar and /bar exists and is a directory, it'll copy /foo inside /bar instead of overwriting it, which is not what rename() wants. So you end up with weird behaviors like in this repro: > {code} > c: > cd \ > md Foo > md Bar > md Foo\X > md Bar\X > hadoop fs -mv file:///c:/Foo file:///c:/Bar > {code} > At the end of this, you would expect to find only Bar\X, but you instead find Bar\X\X. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira