From hdfs-issues-return-210075-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Mon Feb 12 16:53:05 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id C24B2180652 for ; Mon, 12 Feb 2018 16:53:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B1382160C3F; Mon, 12 Feb 2018 15:53:05 +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 CFAC4160C31 for ; Mon, 12 Feb 2018 16:53:04 +0100 (CET) Received: (qmail 17197 invoked by uid 500); 12 Feb 2018 15:53: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 17186 invoked by uid 99); 12 Feb 2018 15:53:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Feb 2018 15:53:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6EB681A081B for ; Mon, 12 Feb 2018 15:53:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, 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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id HVnPeeNfT-WQ for ; Mon, 12 Feb 2018 15:53:02 +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 B848F5F21E for ; Mon, 12 Feb 2018 15:53: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 40265E0112 for ; Mon, 12 Feb 2018 15:53:01 +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 F137921E85 for ; Mon, 12 Feb 2018 15:53:00 +0000 (UTC) Date: Mon, 12 Feb 2018 15:53:00 +0000 (UTC) From: "Hudson (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-10453) ReplicationMonitor thread could stuck for long time due to the race between replication and delete of same file in a large cluster. 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-10453?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1636= 0934#comment-16360934 ]=20 Hudson commented on HDFS-10453: ------------------------------- SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #13645 (See [https= ://builds.apache.org/job/Hadoop-trunk-Commit/13645/]) HDFS-10453. ReplicationMonitor thread could stuck for long time due to (arp= : rev 96bb6a51ec4a470e9b287c94e377444a9f97c410) * (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hd= fs/server/blockmanagement/ErasureCodingWork.java * (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hd= fs/server/blockmanagement/ReplicationWork.java * (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hd= fs/server/blockmanagement/BlockReconstructionWork.java > ReplicationMonitor thread could stuck for long time due to the race betwe= en replication and delete of same file in a large cluster. > -------------------------------------------------------------------------= ---------------------------------------------------------- > > Key: HDFS-10453 > URL: https://issues.apache.org/jira/browse/HDFS-10453 > Project: Hadoop HDFS > Issue Type: Bug > Components: namenode > Affects Versions: 2.4.1, 2.5.2, 2.7.1, 2.6.4 > Reporter: He Xiaoqiao > Assignee: He Xiaoqiao > Priority: Major > Fix For: 3.1.0, 2.10.0, 2.9.1, 3.0.1, 2.8.4, 2.7.6 > > Attachments: HDFS-10453-branch-2.001.patch, HDFS-10453-branch-2.0= 03.patch, HDFS-10453-branch-2.7.004.patch, HDFS-10453-branch-2.7.005.patch,= HDFS-10453-branch-2.7.006.patch, HDFS-10453-branch-2.7.007.patch, HDFS-104= 53-branch-2.7.008.patch, HDFS-10453-branch-2.7.009.patch, HDFS-10453-branch= -2.8.001.patch, HDFS-10453-branch-2.8.002.patch, HDFS-10453-branch-2.9.001.= patch, HDFS-10453-branch-2.9.002.patch, HDFS-10453-branch-3.0.001.patch, HD= FS-10453-branch-3.0.002.patch, HDFS-10453-trunk.001.patch, HDFS-10453-trunk= .002.patch, HDFS-10453.001.patch > > > ReplicationMonitor thread could stuck for long time and loss data with li= ttle probability. Consider the typical scenario=EF=BC=9A > (1) create and close a file with the default replicas(3); > (2) increase replication (to 10) of the file. > (3) delete the file while ReplicationMonitor is scheduling blocks belong = to that file for replications. > if ReplicationMonitor stuck reappeared, NameNode will print log as: > {code:xml} > 2016-04-19 10:20:48,083 WARN org.apache.hadoop.hdfs.server.blockmanagemen= t.BlockPlacementPolicy: Failed to place enough replicas, still in need of 7= to reach 10 (unavailableStorages=3D[], storagePolicy=3DBlockStoragePolicy{= HOT:7, storageTypes=3D[DISK], creationFallbacks=3D[], replicationFallbacks= =3D[ARCHIVE]}, newBlock=3Dfalse) For more information, please enable DEBUG = log level on org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPo= licy > ...... > 2016-04-19 10:21:17,184 WARN org.apache.hadoop.hdfs.server.blockmanagemen= t.BlockPlacementPolicy: Failed to place enough replicas, still in need of 7= to reach 10 (unavailableStorages=3D[DISK], storagePolicy=3DBlockStoragePol= icy{HOT:7, storageTypes=3D[DISK], creationFallbacks=3D[], replicationFallba= cks=3D[ARCHIVE]}, newBlock=3Dfalse) For more information, please enable DEB= UG log level on org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacemen= tPolicy > 2016-04-19 10:21:17,184 WARN org.apache.hadoop.hdfs.protocol.BlockStorage= Policy: Failed to place enough replicas: expected size is 7 but only 0 stor= age types can be selected (replication=3D10, selected=3D[], unavailable=3D[= DISK, ARCHIVE], removed=3D[DISK, DISK, DISK, DISK, DISK, DISK, DISK], polic= y=3DBlockStoragePolicy{HOT:7, storageTypes=3D[DISK], creationFallbacks=3D[]= , replicationFallbacks=3D[ARCHIVE]}) > 2016-04-19 10:21:17,184 WARN org.apache.hadoop.hdfs.server.blockmanagemen= t.BlockPlacementPolicy: Failed to place enough replicas, still in need of 7= to reach 10 (unavailableStorages=3D[DISK, ARCHIVE], storagePolicy=3DBlockS= toragePolicy{HOT:7, storageTypes=3D[DISK], creationFallbacks=3D[], replicat= ionFallbacks=3D[ARCHIVE]}, newBlock=3Dfalse) All required storage types are= unavailable: unavailableStorages=3D[DISK, ARCHIVE], storagePolicy=3DBlock= StoragePolicy{HOT:7, storageTypes=3D[DISK], creationFallbacks=3D[], replica= tionFallbacks=3D[ARCHIVE]} > {code} > This is because 2 threads (#NameNodeRpcServer and #ReplicationMonitor) pr= ocess same block at the same moment. > (1) ReplicationMonitor#computeReplicationWorkForBlocks get blocks to repl= icate and leave the global lock. > (2) FSNamesystem#delete invoked to delete blocks then clear the reference= in blocksmap, needReplications, etc. the block's NumBytes will set NO_ACK(= Long.MAX_VALUE) which is used to indicate that the block deletion does not = need explicit ACK from the node.=20 > (3) ReplicationMonitor#computeReplicationWorkForBlocks continue to choose= Targets for the same blocks and no node will be selected after traverse who= le cluster because no node choice satisfy the goodness criteria (remaining= spaces achieve required size Long.MAX_VALUE).=20 > During of stage#3 ReplicationMonitor stuck for long time, especial in a l= arge cluster. invalidateBlocks & neededReplications continues to grow and n= o consumes. it will loss data at the worst. > This can mostly be avoided by skip chooseTarget for BlockCommand.NO_ACK b= lock and remove it from neededReplications. -- 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