From hdfs-issues-return-211645-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Fri Mar 2 04:40:05 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 239FF18064D for ; Fri, 2 Mar 2018 04:40:04 +0100 (CET) Received: (qmail 71058 invoked by uid 500); 2 Mar 2018 03:40: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 71047 invoked by uid 99); 2 Mar 2018 03:40:03 -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, 02 Mar 2018 03:40:03 +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 24BE5180678 for ; Fri, 2 Mar 2018 03:40:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, 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 gJb4J6xoQ4I7 for ; Fri, 2 Mar 2018 03:40: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 6E4075F17F for ; Fri, 2 Mar 2018 03:40: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 B08C9E022F for ; Fri, 2 Mar 2018 03:40: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 397F024768 for ; Fri, 2 Mar 2018 03:40:00 +0000 (UTC) Date: Fri, 2 Mar 2018 03:40:00 +0000 (UTC) From: "TanYuxin (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-12749) DN may not send block report to NN after NN restart 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-12749?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1638= 3110#comment-16383110 ]=20 TanYuxin commented on HDFS-12749: --------------------------------- Thanks [~hexiaoqiao]=C2=A0 [~xkrogen] very much for reviewing and resolving= the issue. I think v003 patch committed by [~hexiaoqiao] is more effective= and simpler.=20 Anyone mind having a review?=C2=A0 In our production cluster, the problem h= as been fixed for months by the proposed patch. > DN may not send block report to NN after NN restart > --------------------------------------------------- > > Key: HDFS-12749 > URL: https://issues.apache.org/jira/browse/HDFS-12749 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode > Affects Versions: 2.7.1, 2.8.3, 2.7.5, 3.0.0, 2.9.1 > Reporter: TanYuxin > Priority: Major > Attachments: HDFS-12749-branch-2.7.002.patch, HDFS-12749-trunk.00= 3.patch, HDFS-12749.001.patch > > > Now our cluster have thousands of DN, millions of files and blocks. When = NN restart, NN's load is very high. > After NN restart=EF=BC=8CDN will call BPServiceActor#reRegister method to= register. But register RPC will get a IOException since NN is busy dealing= with Block Report. The exception is caught at BPServiceActor#processComma= nd. > Next is the caught IOException: > {code:java} > WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Error processing da= tanode Command > java.io.IOException: Failed on local exception: java.io.IOException: java= .net.SocketTimeoutException: 60000 millis timeout while waiting for channel= to be ready for read. ch : java.nio.channels.SocketChannel[connected local= =3D/DataNode_IP:Port remote=3DNameNode_Host/IP:Port]; Host Details : local = host is: "DataNode_Host/Datanode_IP"; destination host is: "NameNode_Host":= Port; > at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:773= ) > at org.apache.hadoop.ipc.Client.call(Client.java:1474) > at org.apache.hadoop.ipc.Client.call(Client.java:1407) > at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(Protobu= fRpcEngine.java:229) > at com.sun.proxy.$Proxy13.registerDatanode(Unknown Source) > at org.apache.hadoop.hdfs.protocolPB.DatanodeProtocolClientSideTr= anslatorPB.registerDatanode(DatanodeProtocolClientSideTranslatorPB.java:126= ) > at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.register= (BPServiceActor.java:793) > at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.reRegist= er(BPServiceActor.java:926) > at org.apache.hadoop.hdfs.server.datanode.BPOfferService.processC= ommandFromActor(BPOfferService.java:604) > at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.processC= ommand(BPServiceActor.java:898) > at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.offerSer= vice(BPServiceActor.java:711) > at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPSe= rviceActor.java:864) > at java.lang.Thread.run(Thread.java:745) > {code} > The un-catched IOException breaks BPServiceActor#register, and the Block = Report can not be sent immediately.=20 > {code} > /** > * Register one bp with the corresponding NameNode > *

> * The bpDatanode needs to register with the namenode on startup in ord= er > * 1) to report which storage it is serving now and=20 > * 2) to receive a registrationID > * =20 > * issued by the namenode to recognize registered datanodes. > *=20 > * @param nsInfo current NamespaceInfo > * @see FSNamesystem#registerDatanode(DatanodeRegistration) > * @throws IOException > */ > void register(NamespaceInfo nsInfo) throws IOException { > // The handshake() phase loaded the block pool storage > // off disk - so update the bpRegistration object from that info > DatanodeRegistration newBpRegistration =3D bpos.createRegistration(); > LOG.info(this + " beginning handshake with NN"); > while (shouldRun()) { > try { > // Use returned registration from namenode with updated fields > newBpRegistration =3D bpNamenode.registerDatanode(newBpRegistrati= on); > newBpRegistration.setNamespaceInfo(nsInfo); > bpRegistration =3D newBpRegistration; > break; > } catch(EOFException e) { // namenode might have just restarted > LOG.info("Problem connecting to server: " + nnAddr + " :" > + e.getLocalizedMessage()); > sleepAndLogInterrupts(1000, "connecting to server"); > } catch(SocketTimeoutException e) { // namenode is busy > LOG.info("Problem connecting to server: " + nnAddr); > sleepAndLogInterrupts(1000, "connecting to server"); > } > } > =20 > LOG.info("Block pool " + this + " successfully registered with NN"); > bpos.registrationSucceeded(this, bpRegistration); > // random short delay - helps scatter the BR from all DNs > scheduler.scheduleBlockReport(dnConf.initialBlockReportDelay); > } > {code} > But NameNode has processed registerDatanode successfully, so it won't ask= DN to re-register again -- 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