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 0F1AA200C32 for ; Thu, 9 Mar 2017 17:49:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0CC43160B5F; Thu, 9 Mar 2017 16:49:45 +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 2B752160B87 for ; Thu, 9 Mar 2017 17:49:44 +0100 (CET) Received: (qmail 34637 invoked by uid 500); 9 Mar 2017 16:49:43 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 34625 invoked by uid 99); 9 Mar 2017 16:49:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2017 16:49:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id C7DB0C14BD for ; Thu, 9 Mar 2017 16:49:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.451 X-Spam-Level: * X-Spam-Status: No, score=1.451 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id i4E0hbSMImG8 for ; Thu, 9 Mar 2017 16:49:41 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id B33C65FCD9 for ; Thu, 9 Mar 2017 16:49:40 +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 07263E095F for ; Thu, 9 Mar 2017 16:49:40 +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 76595243CC for ; Thu, 9 Mar 2017 16:49:38 +0000 (UTC) Date: Thu, 9 Mar 2017 16:49:38 +0000 (UTC) From: "Manoj Govindassamy (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (HDFS-11486) Client close() should not fail fast if the last block is being decommissioned MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 09 Mar 2017 16:49:45 -0000 [ https://issues.apache.org/jira/browse/HDFS-11486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15903359#comment-15903359 ] Manoj Govindassamy edited comment on HDFS-11486 at 3/9/17 4:49 PM: ------------------------------------------------------------------- [~jojochuang], the decommission file close test you wrote (the first patch attached in this jira), should be passing now. The commit in HDFS-11499 covers both Maintenance and Decommission scenarios, but the test i added for file close only covers maintenance state and subsumes [~linyiqun] test. The other decommission test in HDFS-11499 was more for pipeline recovery during decommissioning. So, your decommissioning file close test can be committed as part of this jira. was (Author: manojg): [~jojochuang], the decommission file close test you wrote (the first patch attached in this jira), should be passing now. The commit in HDFS-11499 covers both Maintenance and Decommission scenarios, but the test i added for file close only covers maintenance state and subsumes [~linyiqun] test. The other decommission test in HDFS-11499 was more for pipeline recovery during decommissioning. > Client close() should not fail fast if the last block is being decommissioned > ----------------------------------------------------------------------------- > > Key: HDFS-11486 > URL: https://issues.apache.org/jira/browse/HDFS-11486 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 2.6.0 > Reporter: Wei-Chiu Chuang > Assignee: Wei-Chiu Chuang > Attachments: HDF-11486.test.patch, HDFS-11486.001.patch, HDFS-11486.test-inmaintenance.patch > > > If a DFS client closes a file while the last block is being decommissioned, the close() may fail if the decommission of the block does not complete in a few seconds. > When a DataNode is being decommissioned, NameNode marks the DN's state as DECOMMISSION_INPROGRESS_INPROGRESS, and blocks with replicas on these DataNodes become under-replicated immediately. A close() call which attempts to complete the last open block will fail if the number of live replicas is below minimal replicated factor, due to too many replicas residing on the DataNodes. > The client internally will try to complete the last open block for up to 5 times by default, which is roughly 12 seconds. After that, close() throws an exception like the following, which is typically not handled properly. > {noformat} > java.io.IOException: Unable to close file because the last blockBP-33575088-10.0.0.200-1488410554081:blk_1073741827_1003 does not have enough number of replicas. > at org.apache.hadoop.hdfs.DFSOutputStream.completeFile(DFSOutputStream.java:864) > at org.apache.hadoop.hdfs.DFSOutputStream.closeImpl(DFSOutputStream.java:827) > at org.apache.hadoop.hdfs.DFSOutputStream.close(DFSOutputStream.java:793) > at org.apache.hadoop.fs.FSDataOutputStream$PositionCache.close(FSDataOutputStream.java:72) > at org.apache.hadoop.fs.FSDataOutputStream.close(FSDataOutputStream.java:101) > at org.apache.hadoop.hdfs.TestDecommission.testCloseWhileDecommission(TestDecommission.java:708) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) > at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) > at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) > at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) > {noformat} > Once the exception is thrown, the client usually does not attempt to close again, so the file remains in open state, and the last block remains in under replicated state. > Subsequently, administrator runs recoverLease tool to salvage the file, but the attempt failed because the block remains in under replicated state. It is not clear why the block is never replicated though. However, administrators think it becomes a corrupt file because the file remains open via fsck -openforwrite and the file modification time is hours ago. > In summary, I do not think close() should fail because the last block is being decommissioned. The block has sufficient number replicas, and it's just that some replicas are being decommissioned. Decomm should be transparent to clients. > This issue seems to be more prominent on a very large scale cluster, with min replication factor set to 2. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org