Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5C7AB200CA4 for ; Wed, 7 Jun 2017 23:41:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5AF99160BE2; Wed, 7 Jun 2017 21:41:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7A0E2160BBF for ; Wed, 7 Jun 2017 23:41:21 +0200 (CEST) Received: (qmail 60446 invoked by uid 500); 7 Jun 2017 21:41:20 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 60435 invoked by uid 99); 7 Jun 2017 21:41:20 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2017 21:41:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 37F24C2062 for ; Wed, 7 Jun 2017 21:41:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.211 X-Spam-Level: X-Spam-Status: No, score=-99.211 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id a4ZQJHklTMJv for ; Wed, 7 Jun 2017 21:41:19 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 0FB485F6C6 for ; Wed, 7 Jun 2017 21:41:19 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 84B66E0AE8 for ; Wed, 7 Jun 2017 21:41:18 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 407AA21E0E for ; Wed, 7 Jun 2017 21:41:18 +0000 (UTC) Date: Wed, 7 Jun 2017 21:41:18 +0000 (UTC) From: "Aaron Fabbri (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-14457) create() does not notify metadataStore of parent directories or ensure they're not existing files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 07 Jun 2017 21:41:22 -0000 [ https://issues.apache.org/jira/browse/HADOOP-14457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16041678#comment-16041678 ] Aaron Fabbri commented on HADOOP-14457: --------------------------------------- [~mackrorysd] how do you feel about splitting this patch up into multiple jiras? I'm happy to help. 1. Add new create contract test that validates ancestor directory creation. 2. ProvidedFileStatusIterator#next() may throw IndexOutOfBoundsException 3. Simplify mkdir() 4. S3Guard: populate ancestors in create() since S3AFileSystem doesn't do it. > create() does not notify metadataStore of parent directories or ensure they're not existing files > ------------------------------------------------------------------------------------------------- > > Key: HADOOP-14457 > URL: https://issues.apache.org/jira/browse/HADOOP-14457 > Project: Hadoop Common > Issue Type: Sub-task > Components: fs/s3 > Reporter: Sean Mackrory > Assignee: Sean Mackrory > Attachments: HADOOP-14457-HADOOP-13345.001.patch, HADOOP-14457-HADOOP-13345.002.patch, HADOOP-14457-HADOOP-13345.003.patch, HADOOP-14457-HADOOP-13345.004.patch, HADOOP-14457-HADOOP-13345.005.patch > > > Not a great test yet, but it at least reliably demonstrates the issue. LocalMetadataStore will sometimes erroneously report that a directory is empty with isAuthoritative = true when it *definitely* has children the metadatastore should know about. It doesn't appear to happen if the children are just directory. The fact that it's returning an empty listing is concerning, but the fact that it says it's authoritative *might* be a second bug. > {code} > diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java > index 78b3970..1821d19 100644 > --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java > +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java > @@ -965,7 +965,7 @@ public boolean hasMetadataStore() { > } > > @VisibleForTesting > - MetadataStore getMetadataStore() { > + public MetadataStore getMetadataStore() { > return metadataStore; > } > > diff --git a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/contract/s3a/ITestS3AContractRename.java b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/contract/s3a/ITestS3AContractRename.java > index 4339649..881bdc9 100644 > --- a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/contract/s3a/ITestS3AContractRename.java > +++ b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/contract/s3a/ITestS3AContractRename.java > @@ -23,6 +23,11 @@ > import org.apache.hadoop.fs.contract.AbstractFSContract; > import org.apache.hadoop.fs.FileSystem; > import org.apache.hadoop.fs.Path; > +import org.apache.hadoop.fs.s3a.S3AFileSystem; > +import org.apache.hadoop.fs.s3a.Tristate; > +import org.apache.hadoop.fs.s3a.s3guard.DirListingMetadata; > +import org.apache.hadoop.fs.s3a.s3guard.MetadataStore; > +import org.junit.Test; > > import static org.apache.hadoop.fs.contract.ContractTestUtils.dataset; > import static org.apache.hadoop.fs.contract.ContractTestUtils.writeDataset; > @@ -72,4 +77,24 @@ public void testRenameDirIntoExistingDir() throws Throwable { > boolean rename = fs.rename(srcDir, destDir); > assertFalse("s3a doesn't support rename to non-empty directory", rename); > } > + > + @Test > + public void testMkdirPopulatesFileAncestors() throws Exception { > + final FileSystem fs = getFileSystem(); > + final MetadataStore ms = ((S3AFileSystem) fs).getMetadataStore(); > + final Path parent = path("testMkdirPopulatesFileAncestors/source"); > + try { > + fs.mkdirs(parent); > + final Path nestedFile = new Path(parent, "dir1/dir2/dir3/file4"); > + byte[] srcDataset = dataset(256, 'a', 'z'); > + writeDataset(fs, nestedFile, srcDataset, srcDataset.length, > + 1024, false); > + > + DirListingMetadata list = ms.listChildren(parent); > + assertTrue("MetadataStore falsely reports authoritative empty list", > + list.isEmpty() == Tristate.FALSE || !list.isAuthoritative()); > + } finally { > + fs.delete(parent, true); > + } > + } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org