Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9428018DF5 for ; Wed, 11 Nov 2015 02:37:16 +0000 (UTC) Received: (qmail 70867 invoked by uid 500); 11 Nov 2015 02:37:11 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 70783 invoked by uid 500); 11 Nov 2015 02:37:11 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 70633 invoked by uid 99); 11 Nov 2015 02:37:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Nov 2015 02:37:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 0E42E2C1F5C for ; Wed, 11 Nov 2015 02:37:11 +0000 (UTC) Date: Wed, 11 Nov 2015 02:37:11 +0000 (UTC) From: "Uma Maheswara Rao G (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-9381) When same block came for replication for Striped mode, we can move that block to PendingReplications MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-9381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Uma Maheswara Rao G updated HDFS-9381: -------------------------------------- Attachment: HDFS-9381.00.patch Attached the simple patch which shows the fix proposed. > When same block came for replication for Striped mode, we can move that block to PendingReplications > ---------------------------------------------------------------------------------------------------- > > Key: HDFS-9381 > URL: https://issues.apache.org/jira/browse/HDFS-9381 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: erasure-coding, namenode > Affects Versions: 3.0.0 > Reporter: Uma Maheswara Rao G > Assignee: Uma Maheswara Rao G > Attachments: HDFS-9381.00.patch > > > Currently I noticed that we are just returning null if block already exists in pendingReplications in replication flow for striped blocks. > {code} > if (block.isStriped()) { > if (pendingNum > 0) { > // Wait the previous recovery to finish. > return null; > } > {code} > Here if we just return null and if neededReplications contains only fewer blocks(basically by default if less than numliveNodes*2), then same blocks can be picked again from neededReplications from next loop as we are not removing element from neededReplications. Since this replication process need to take fsnamesystmem lock and do, we may spend some time unnecessarily in every loop. > So my suggestion/improvement is: > Instead of just returning null, how about incrementing pendingReplications for this block and remove from neededReplications? and also another point to consider here is, to add into pendingReplications, generally we need target and it is nothing but to which node we issued replication command. Later when after replication success and DN reported it, block will be removed from pendingReplications from NN addBlock. > So since this is newly picked block from neededReplications, we would not have selected target yet. So which target to be passed to pendingReplications if we add this block? One Option I am thinking is, how about just passing srcNode itself as target for this special condition? So, anyway if the block is really missed, srcNode will not report it. So this block will not be removed from pending replications, so that when it is timed out, it will be considered for replication again and that time it will find actual target to replicate while processing as part of regular replication flow. -- This message was sent by Atlassian JIRA (v6.3.4#6332)