Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 54282 invoked from network); 8 Jun 2007 20:15:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jun 2007 20:15:51 -0000 Received: (qmail 16596 invoked by uid 500); 8 Jun 2007 20:15:51 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 16535 invoked by uid 500); 8 Jun 2007 20:15:50 -0000 Mailing-List: contact hadoop-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-dev@lucene.apache.org Received: (qmail 16522 invoked by uid 99); 8 Jun 2007 20:15:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2007 13:15:50 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2007 13:15:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2079D7141F4 for ; Fri, 8 Jun 2007 13:15:26 -0700 (PDT) Message-ID: <14143299.1181333726130.JavaMail.jira@brutus> Date: Fri, 8 Jun 2007 13:15:26 -0700 (PDT) From: "dhruba borthakur (JIRA)" To: hadoop-dev@lucene.apache.org Subject: [jira] Updated: (HADOOP-1444) Block allocation method does not check pendingCreates for duplicate block ids In-Reply-To: <2658179.1180546215584.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-1444?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] dhruba borthakur updated HADOOP-1444: ------------------------------------- Attachment: duplicateBlockId2.patch Implemented all review comments except the one related to "better logging by abandonBlock". The reason i did not change it in this patch because it is not directly related to this issue and could conflict with another patch that I have outstanding. I am going to fix this logging issue as part of a separate JIRA issue. > Block allocation method does not check pendingCreates for duplicate block ids > ----------------------------------------------------------------------------- > > Key: HADOOP-1444 > URL: https://issues.apache.org/jira/browse/HADOOP-1444 > Project: Hadoop > Issue Type: Bug > Components: dfs > Reporter: dhruba borthakur > Assignee: dhruba borthakur > Attachments: duplicateBlockId2.patch > > > The HDFS namenode allocates a new random blockid when requested. It then checks the blocksMap to verify if this blockid is already in use. If this block is is already in use, it generates another random number and above process continues. When a blocksid that does not exist in the blocksMap is found, it stores this blocksid in pendingCreateBlocks and returns the blocksid to the requesting client. > The above check for detecting duplicate blockid should check pendingCreateBlocks as well. > A related problem exists when a file is deleted. Deleting a file causes all its blocks to be deleted from the blocksMap immediately. These blockids move to recentInvalidateSets and are sent out to the corresponding datanodes as part of responses to succeeding heartbeats. So, there is a time window when a block exists in the datanode but not in the blocksMap. At this time, if the blockid-random-number generator generates a blockid that exists in the datanode but not on the blocksMap, then the namenode will fail to detect that this is a duplicate blockid. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.