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 5B1C5183C0 for ; Wed, 3 Feb 2016 13:19:40 +0000 (UTC) Received: (qmail 48726 invoked by uid 500); 3 Feb 2016 13:19:40 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 48668 invoked by uid 500); 3 Feb 2016 13:19:40 -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 48651 invoked by uid 99); 3 Feb 2016 13:19:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Feb 2016 13:19:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C57612C14F0 for ; Wed, 3 Feb 2016 13:19:39 +0000 (UTC) Date: Wed, 3 Feb 2016 13:19:39 +0000 (UTC) From: "Walter Su (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-9748) When addExpectedReplicasToPending is called twice, pendingReplications should avoid duplication 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-9748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Walter Su updated HDFS-9748: ---------------------------- Affects Version/s: 2.8.0 Status: Patch Available (was: Open) > When addExpectedReplicasToPending is called twice, pendingReplications should avoid duplication > ----------------------------------------------------------------------------------------------- > > Key: HDFS-9748 > URL: https://issues.apache.org/jira/browse/HDFS-9748 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 2.8.0 > Reporter: Walter Su > Assignee: Walter Su > Priority: Minor > Attachments: HDFS-9748.01.patch > > > 1. When completeFile() is called, addExpectedReplicasToPending() will be called (HDFS-8999). > 2. When first replica is reported, addExpectedReplicasToPending() will be called the second time. > {code} > //BlockManager.addStoredBlock(..) > if(storedBlock.getBlockUCState() == BlockUCState.COMMITTED && > hasMinStorage(storedBlock, numLiveReplicas)) { > addExpectedReplicasToPending(storedBlock, bc); > completeBlock(storedBlock, false); > } else if (storedBlock.isComplete() && result == AddBlockResult.ADDED) { > {code} > But, > {code} > //PendingReplicationBlocks.java > void incrementReplicas(DatanodeDescriptor... newTargets) { > if (newTargets != null) { > Collections.addAll(targets, newTargets); > } > } > {code} > targets is ArrayList, the above code simply add all {{newTargets}} to {{targets}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)