From hdfs-issues-return-227011-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Fri Jul 20 23:43:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E6544180663 for ; Fri, 20 Jul 2018 23:43:03 +0200 (CEST) Received: (qmail 89226 invoked by uid 500); 20 Jul 2018 21:43:03 -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 89213 invoked by uid 99); 20 Jul 2018 21:43:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jul 2018 21:43:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 880CA1809D5 for ; Fri, 20 Jul 2018 21:43:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id mcuTaGDUWQVh for ; Fri, 20 Jul 2018 21:43:01 +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 5D3735F3B4 for ; Fri, 20 Jul 2018 21:43:01 +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 C1ADDE1E11 for ; Fri, 20 Jul 2018 21:43:00 +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 412AB27143 for ; Fri, 20 Jul 2018 21:43:00 +0000 (UTC) Date: Fri, 20 Jul 2018 21:43:00 +0000 (UTC) From: "Wei-Chiu Chuang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-13758) DatanodeManager should throw exception if it has BlockRecoveryCommand but the block is not under construction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-13758?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Wei-Chiu Chuang updated HDFS-13758: ----------------------------------- Attachment: HDFS-10240 scenarios.jpg > DatanodeManager should throw exception if it has BlockRecoveryCommand but= the block is not under construction > -------------------------------------------------------------------------= ------------------------------------ > > Key: HDFS-13758 > URL: https://issues.apache.org/jira/browse/HDFS-13758 > Project: Hadoop HDFS > Issue Type: Bug > Components: namenode > Affects Versions: 3.0.0-alpha1 > Reporter: Wei-Chiu Chuang > Priority: Major > Attachments: HDFS-10240 scenarios.jpg > > > In Hadoop 3, HDFS-8909 added an assertion assumption that if a BlockRecov= eryCommand exists for a block, the block=C2=A0is under construction. > =C2=A0 > {code:title=3DDatanodeManager#getBlockRecoveryCommand()} > BlockRecoveryCommand brCommand =3D new BlockRecoveryCommand(blocks.leng= th); > for (BlockInfo b : blocks) { > BlockUnderConstructionFeature uc =3D b.getUnderConstructionFeature(); > assert uc !=3D null; > ... > {code} > This assertion accidentally fixed one of the possible scenario of HDFS-10= 240 data corruption, if a recoverLease() is made immediately followed by a = close(), before DataNodes have the chance to heartbeat. > In a unit test you'll get: > {noformat} > 2018-07-19 09:43:41,331 [IPC Server handler 9 on 57890] WARN ipc.Server = (Server.java:logException(2724)) - IPC Server handler 9 on 57890, call Call= #41 Retry#0 org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.sendHea= rtbeat from 127.0.0.1:57903 > java.lang.AssertionError > =09at org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager.getBl= ockRecoveryCommand(DatanodeManager.java:1551) > =09at org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager.handl= eHeartbeat(DatanodeManager.java:1661) > =09at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.handleHeartbeat= (FSNamesystem.java:3865) > =09at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.sendHeartb= eat(NameNodeRpcServer.java:1504) > =09at org.apache.hadoop.hdfs.protocolPB.DatanodeProtocolServerSideTransla= torPB.sendHeartbeat(DatanodeProtocolServerSideTranslatorPB.java:119) > =09at org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos$Datano= deProtocolService$2.callBlockingMethod(DatanodeProtocolProtos.java:31660) > =09at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.c= all(ProtobufRpcEngine.java:524) > =09at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1025) > =09at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:876) > =09at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:822) > =09at java.security.AccessController.doPrivileged(Native Method) > =09at javax.security.auth.Subject.doAs(Subject.java:422) > =09at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInfor= mation.java:1689) > =09at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2682) > {noformat} > I propose to change this assertion even though it address the data corrup= tion, because: > # We should throw an more meaningful exception than an NPE > # on a production cluster, the assert is ignored, and you'll get a more n= oticeable NPE. Future HDFS developers might fix this NPE, causing regressio= n. An NPE is typically not captured and handled, so there's a chance to res= ult in internal state inconsistency. > # It doesn't address all possible scenarios of HDFS-10240. A proper fix s= hould reject close() if the block is being recovered. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org