From hdfs-issues-return-253248-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Tue Feb 26 13:23:47 2019 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 C41C118062C for ; Tue, 26 Feb 2019 14:23:46 +0100 (CET) Received: (qmail 24773 invoked by uid 500); 26 Feb 2019 13:23:45 -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 24761 invoked by uid 99); 26 Feb 2019 13:23:45 -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; Tue, 26 Feb 2019 13:23:45 +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 4FF1C18188F for ; Tue, 26 Feb 2019 13:23:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.5 X-Spam-Level: X-Spam-Status: No, score=-109.5 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, URIBL_BLOCKED=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 X3KJgHFY9Wxa for ; Tue, 26 Feb 2019 13:23:43 +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 632296100E for ; Tue, 26 Feb 2019 13:17: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 F3BAEE00A7 for ; Tue, 26 Feb 2019 13:17: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 2B9C824564 for ; Tue, 26 Feb 2019 13:17:00 +0000 (UTC) Date: Tue, 26 Feb 2019 13:17:00 +0000 (UTC) From: "Hadoop QA (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-14314) fullBlockReportLeaseId should be reset after registering to NN 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-14314?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1677= 7899#comment-16777899 ]=20 Hadoop QA commented on HDFS-14314: ---------------------------------- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 34s= {color} | {color:blue} Docker mode activated. {color} | || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0= m 0s{color} | {color:green} The patch does not contain any @author tags. {= color} | | {color:green}+1{color} | {color:green} test4tests {color} | {color:green}= 0m 0s{color} | {color:green} The patch appears to include 1 new or modif= ied test files. {color} | || || || || {color:brown} trunk Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}= 17m 9s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0= m 58s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}= 0m 51s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 1= m 3s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:gree= n} 13m 10s{color} | {color:green} branch has no errors when building and te= sting our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} = 2m 10s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0= m 51s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:red}-1{color} | {color:red} mvninstall {color} | {color:red} 0m 5= 0s{color} | {color:red} hadoop-hdfs in the patch failed. {color} | | {color:red}-1{color} | {color:red} compile {color} | {color:red} 0m 51s{= color} | {color:red} hadoop-hdfs in the patch failed. {color} | | {color:red}-1{color} | {color:red} javac {color} | {color:red} 0m 51s{co= lor} | {color:red} hadoop-hdfs in the patch failed. {color} | | {color:orange}-0{color} | {color:orange} checkstyle {color} | {color:oran= ge} 0m 47s{color} | {color:orange} hadoop-hdfs-project/hadoop-hdfs: The pa= tch generated 12 new + 52 unchanged - 0 fixed =3D 64 total (was 52) {color}= | | {color:red}-1{color} | {color:red} mvnsite {color} | {color:red} 0m 53s{= color} | {color:red} hadoop-hdfs in the patch failed. {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green}= 0m 0s{color} | {color:green} The patch has no whitespace issues. {color}= | | {color:red}-1{color} | {color:red} shadedclient {color} | {color:red} 3m= 21s{color} | {color:red} patch has errors when building and testing our cl= ient artifacts. {color} | | {color:red}-1{color} | {color:red} findbugs {color} | {color:red} 0m 32s= {color} | {color:red} hadoop-hdfs in the patch failed. {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0= m 45s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:red}-1{color} | {color:red} unit {color} | {color:red} 0m 52s{col= or} | {color:red} hadoop-hdfs in the patch failed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green}= 0m 23s{color} | {color:green} The patch does not generate ASF License war= nings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 45m 43s{colo= r} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Docker | Client=3D17.05.0-ce Server=3D17.05.0-ce Image:yetus/hadoop:8f97d= 6f | | JIRA Issue | HDFS-14314 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/1296017= 1/HDFS-14314-trunk.001.patch | | Optional Tests | dupname asflicense compile javac javadoc mvninstal= l mvnsite unit shadedclient findbugs checkstyle | | uname | Linux 24b01f282ab8 3.13.0-153-generic #203-Ubuntu SMP Thu Jun 14 = 08:52:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / 59ba355 | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_191 | | findbugs | v3.1.0-RC1 | | mvninstall | https://builds.apache.org/job/PreCommit-HDFS-Build/26328/art= ifact/out/patch-mvninstall-hadoop-hdfs-project_hadoop-hdfs.txt | | compile | https://builds.apache.org/job/PreCommit-HDFS-Build/26328/artifa= ct/out/patch-compile-hadoop-hdfs-project_hadoop-hdfs.txt | | javac | https://builds.apache.org/job/PreCommit-HDFS-Build/26328/artifact= /out/patch-compile-hadoop-hdfs-project_hadoop-hdfs.txt | | checkstyle | https://builds.apache.org/job/PreCommit-HDFS-Build/26328/art= ifact/out/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs.txt | | mvnsite | https://builds.apache.org/job/PreCommit-HDFS-Build/26328/artifa= ct/out/patch-mvnsite-hadoop-hdfs-project_hadoop-hdfs.txt | | findbugs | https://builds.apache.org/job/PreCommit-HDFS-Build/26328/artif= act/out/patch-findbugs-hadoop-hdfs-project_hadoop-hdfs.txt | | unit | https://builds.apache.org/job/PreCommit-HDFS-Build/26328/artifact/= out/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt | | Test Results | https://builds.apache.org/job/PreCommit-HDFS-Build/26328/= testReport/ | | Max. process+thread count | 306 (vs. ulimit of 10000) | | modules | C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoo= p-hdfs | | Console output | https://builds.apache.org/job/PreCommit-HDFS-Build/26328= /console | | Powered by | Apache Yetus 0.8.0 http://yetus.apache.org | This message was automatically generated. > fullBlockReportLeaseId should be reset after registering to NN > -------------------------------------------------------------- > > Key: HDFS-14314 > URL: https://issues.apache.org/jira/browse/HDFS-14314 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode > Affects Versions: 2.8.4 > Environment: =C2=A0 > =C2=A0 > =C2=A0 > Reporter: star > Priority: Critical > Fix For: 2.8.4 > > Attachments: HDFS-14314-trunk.001.patch, HDFS-14314-trunk.001.pat= ch, HDFS-14314.0.patch, HDFS-14314.2.patch, HDFS-14314.patch > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 since HDFS-7923 ,to rate-limit DN block re= port, DN will ask for a full block lease id from active NN before sending f= ull block to NN. Then DN will send full block report together with lease id= . If the lease id is invalid, NN will reject the full block report and log = "not in the pending set". > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 In a case when DN is doing full block repo= rting while NN is restarted. It happens that DN will later send a full bloc= k report with lease id ,acquired from previous NN instance, which is invali= d to the new NN instance. Though DN recognized the new NN instance by heart= beat and reregister itself, it did not reset the lease id from previous ins= tance. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The issuse may cause DNs to temporarily go= dead, making it unsafe to restart NN especially in hadoop cluster which ha= s large amount of DNs. HDFS-12914 reported the issue=C2=A0 without any clue= s why it occurred and remain unsolved. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 To make it clear, look at code below= . We take it from method offerService of class BPServiceActor. We eliminate= some code to focus on current issue. fullBlockReportLeaseId is a local var= iable to hold lease id from NN. Exceptions will occur at blockReport call w= hen NN restarting, which will be caught by catch block in while loop. Thus = fullBlockReportLeaseId will not be set to 0. After NN restarted, DN will se= nd full block report which will be rejected by the new NN instance. DN will= never send full block report until the next full block report schedule, ab= out an hour later. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Solution is simple, just reset fullBlockRe= portLeaseId to 0 after any exception or after registering to NN. Thus it wi= ll ask for a valid fullBlockReportLeaseId from new NN instance. > {code:java} > private void offerService() throws Exception { > long fullBlockReportLeaseId =3D 0; > // > // Now loop for a long time.... > // > while (shouldRun()) { > try { > final long startTime =3D scheduler.monotonicNow(); > // > // Every so often, send heartbeat or block-report > // > final boolean sendHeartbeat =3D scheduler.isHeartbeatDue(startTime)= ; > HeartbeatResponse resp =3D null; > if (sendHeartbeat) { > =20 > boolean requestBlockReportLease =3D (fullBlockReportLeaseId =3D= =3D 0) && > scheduler.isBlockReportDue(startTime); > scheduler.scheduleNextHeartbeat(); > if (!dn.areHeartbeatsDisabledForTests()) { > resp =3D sendHeartBeat(requestBlockReportLease); > assert resp !=3D null; > if (resp.getFullBlockReportLeaseId() !=3D 0) { > if (fullBlockReportLeaseId !=3D 0) { > LOG.warn(nnAddr + " sent back a full block report lease " + > "ID of 0x" + > Long.toHexString(resp.getFullBlockReportLeaseId()) = + > ", but we already have a lease ID of 0x" + > Long.toHexString(fullBlockReportLeaseId) + ". " + > "Overwriting old lease ID."); > } > fullBlockReportLeaseId =3D resp.getFullBlockReportLeaseId(); > } > =20 > } > } > =20 > =20 > if ((fullBlockReportLeaseId !=3D 0) || forceFullBr) { > //Exception occurred here when NN restarting > cmds =3D blockReport(fullBlockReportLeaseId); > fullBlockReportLeaseId =3D 0; > } > =20 > } catch(RemoteException re) { > =20 > } // while (shouldRun()) > } // offerService{code} > =C2=A0 -- 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