Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 43504 invoked from network); 1 Aug 2008 06:16:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2008 06:16:24 -0000 Received: (qmail 25052 invoked by uid 500); 1 Aug 2008 06:16:22 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 25015 invoked by uid 500); 1 Aug 2008 06:16:22 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 25004 invoked by uid 99); 1 Aug 2008 06:16:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Jul 2008 23:16:22 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhruba@gmail.com designates 209.85.128.189 as permitted sender) Received: from [209.85.128.189] (HELO fk-out-0910.google.com) (209.85.128.189) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2008 06:15:27 +0000 Received: by fk-out-0910.google.com with SMTP id 26so750984fkx.13 for ; Thu, 31 Jul 2008 23:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=i7PJ9+7YUSsMwmhUAon2XIxM6MFxbS4Aoo0yKDr5XDM=; b=o9i0ZLEQMYECDV/Ar4XWJv3V6LzxhG/UT0XMGJNBVgBmkDwECHGhzy8/Sg3EYeaJmZ Yjd2yyOWBTqXnHUH638buSNYaWNzBWZ5vNfGJR7UBT9z27PlAkzY8QE9UDUqdwvTDcB9 Hon7vCqQxzyPNxWUuFD0YtHOQ7T648gHmhMuQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=SPbDurAJ3H7S7FL6kZgxacK6Ek4Vf38/T5CmHWwEHki2hp913fZJHLCRNpi1zNh3IG 2UuQrW3e/e/1kfSoKMGAEO9Ah+4d1/Bsz9WvHMPYY48W/ihyrasD4zH1nZCjDEGJmefg uumbpxbd+fSF7iQqw+EvtphAkktrXxWMb65Z0= Received: by 10.125.68.6 with SMTP id v6mr540555mkk.124.1217571334667; Thu, 31 Jul 2008 23:15:34 -0700 (PDT) Received: by 10.125.145.7 with HTTP; Thu, 31 Jul 2008 23:15:34 -0700 (PDT) Message-ID: <4aa34eb70807312315k314a3a5j7260fb931897c7cf@mail.gmail.com> Date: Thu, 31 Jul 2008 22:15:34 -0800 From: "Dhruba Borthakur" To: core-dev@hadoop.apache.org Subject: Re: HDFS : Question on INodeFileUnderConstruction targets filed .. In-Reply-To: <811fc3830807311327g40ec854x3acf0ce2eb791441@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <811fc3830807311318r20702652s2b4f99cc22dce6e7@mail.gmail.com> <811fc3830807311327g40ec854x3acf0ce2eb791441@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org The "targets" field is used to record the block location(s of the last allocated block fro a file. It is important to remember this at block allocation time itself so that data written to the block can be recovered if the client dies before it finished writing to the entire block. Take the case when the client started writing to the 3 datanodes in the pipeline for that block. Now, let's assume that the client died aftre writing 100 bytes to the first two replicas whereas the third replica has only 50 bytes in the block. The namenode holds a lease for this client. If the client dies prematurely, the namenode experiences a timeout for the client and triggers lease recovery for the file(s) that were being written by the client. The namenode has to ensure that all the three replicas are consistent with one another, otherwise readers of the block might see inconsistent data depending on which replica they access. Thus, the namenode has to remember which datanode(s) possibly has replicas of that block. hope this help, dhruba On Thu, Jul 31, 2008 at 12:27 PM, Sangmin Lee wrote: > To clarify my question, what is the need for storing the locations of last > block without being reported by datanodes? > > On Thu, Jul 31, 2008 at 3:18 PM, Sangmin Lee wrote: > >> Hi folks, >> >> I wonder why hadoop.dfs.INodeFileUnderConstruction Class has "targets" >> field. >> Can anyone explain this to me? >> any help would be appreciated. >> >> -sangmin >> >