Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4053F17BFD for ; Tue, 24 Feb 2015 18:07:06 +0000 (UTC) Received: (qmail 77389 invoked by uid 500); 24 Feb 2015 18:06:01 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 77283 invoked by uid 500); 24 Feb 2015 18:06:01 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 77273 invoked by uid 99); 24 Feb 2015 18:06:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Feb 2015 18:06:01 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [72.30.239.147] (HELO nm39-vm3.bullet.mail.bf1.yahoo.com) (72.30.239.147) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Feb 2015 18:05:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1424800925; bh=9rdmAGy/rFNqho0rCt6YQuB2IIAHv74L5HWMu2to2m8=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=GwE19f+j9Sd+hbTK/ZuaGxBlW5UENVgkVC/Sr4nynfcKpJybJvl+uFSGHCD/b8eZPGHPkHt0RKoqLp9/HLsJ7SeL3kSTU44r4Ks80PPB8eLDVb+i+u8cThu0gJNUD2LCIT3CDgjO/7wHXQQS8mEr9zEBbI7z5TX8dP3oW5dZH8ETNYlG63G/hZLKoosy/JeQDJbE4nw9objf4y5OmVlhblI+UUFMXtfzWWpG7/u6Qt4Q9Af+UqY8tpfZr30Cgfly07NWAHAmrz5cK3StrFAMLIRI9yJmL9ZeLFE1W7bbfcDzsTdqoYM3QUnXDxZkS/Ya5Lx47JtPTbpvUtZAXGsfrg== Received: from [66.196.81.172] by nm39.bullet.mail.bf1.yahoo.com with NNFMP; 24 Feb 2015 18:02:05 -0000 Received: from [98.139.212.245] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 24 Feb 2015 18:02:05 -0000 Received: from [127.0.0.1] by omp1054.mail.bf1.yahoo.com with NNFMP; 24 Feb 2015 18:02:05 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 176531.35885.bm@omp1054.mail.bf1.yahoo.com X-YMail-OSG: qIjaV0wVM1n7SUkTjzkiEme1hjFK4eKx8da2BgDkoS.fHRkvvwaBJvomYJzcwSu jODpVf85rGoDQ4hmYIEsctg_k275crIrCy6EsR9LbtWqyTRPkGKkjTb5ie0mOWE9.OIJGIJdFC45 dWmzIcbJZZrlWHbu3VzTIVLln84b7rehH4woI4ubtkdJ5_PhPNf9NYHH8ArYEWyGWGceTbPKm7p6 MW17ulYCMyU1JrPU7yoiq.KvmX61hyuEquPUS2N_EUGDq.YFFHB0klYKqets4I41kSbBDxBaUJ_Q WPZRZy2X9_CkZ5NLPy5xhpUoLwuyiCQed.mUvdngsABkZhJhFg.ju8JuKmHSRb2hYhKFHW47s2uT irXTpiAJUgPvLCxuxUurO9QvdaStf.2SNSF7FL8.99O6BYxnCmXW_sXU4fujZ0yiSw5_n9nFaf7S s3CuFGckwOdz6okDYFsL_DVuIuExkjEBPbn7n2SRkOk.mEWWAQ6rDq9BQFqP4sMa5vV9kBKWnlON T7SinkjFYZmkPhcDhXe5fg2Q- Received: by 66.196.80.118; Tue, 24 Feb 2015 18:02:04 +0000 Date: Tue, 24 Feb 2015 18:02:04 +0000 (UTC) From: Ravi Prakash Reply-To: Ravi Prakash To: "user@hadoop.apache.org" Message-ID: <689505646.9675475.1424800924120.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: References: Subject: Re: recoverLeaseInternal: why current leasehonder is forbidden to append the file? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9675474_1747640844.1424800924115" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_9675474_1747640844.1424800924115 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Dmitry! I suspect its because we don't want two streams from the same DFSClient to = write to the same file. The Lease.holder is a simple string which correspon= ds usually to DFSClient_ . HTH Ravi.=20 On Tuesday, February 24, 2015 12:12 AM, Dmitry Simonov wrote: =20 Hello! Could you please explain, why this check exists in class "org.apache.hadoop= .hdfs.server.namenode.FSNamesystem", method "recoverLeaseInternal": Lease leaseFile =3D leaseManager.getLeaseByPath(src);=C2=A0 =C2=A0 =C2=A0 = =C2=A0 if (leaseFile !=3D null && leaseFile.equals(lease)) {=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 throw new AlreadyBeingCreatedException(=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 "failed to create file " + src + " for " + hold= er +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 " for client " + clientMachin= e +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 " because current leaseholder = is trying to recreate file."); It prevents leaseholder to recover the lease if the lease already belongs t= o him. This method is called both in append() and create() methods of=C2=A0org.apa= che.hadoop.hdfs.server.namenode.NameNodeRpcServer It seems to me that current leaseholder should be able to append the file n= ormally. Am I wrong? Hadoop version: 2.5.1 --Best regards, Dmitrii Simonov. ------=_Part_9675474_1747640844.1424800924115 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dmitry!
I suspect = its because we don't want two streams from the same DFSClient to write to t= he same file. The Lease.holder is a simple string which corresponds usually= to DFSClient_<someid> .

HTH
Ravi.


On Tuesday, February 24, 20= 15 12:12 AM, Dmitry Simonov <dimmoborgir@gmail.com> wrote:


Hello!

Could you please explain, why t= his check exists in class "org.apache.hadoop.hdfs.server.namenode.FSNamesys= tem", method "recoverLeaseInternal":

Leas= e leaseFile =3D leaseManager.getLeaseByPath(src);
    &= nbsp;   if (leaseFile !=3D null && leaseFile.equals(lease)) {<= /div>
          throw new AlreadyBeingCreatedE= xception(
            "failed to cr= eate file " + src + " for " + holder +
       = ;     " for client " + clientMachine +
    &n= bsp;       " because current leaseholder is trying to recrea= te file.");

It prevents leaseholder to = recover the lease if the lease already belongs to him.

=
This method is called both in append() and create() methods of or= g.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer

=
It seems to me that current leaseholder should be able to append the f= ile normally. Am I wrong?

Hadoop version: 2.5.1
--
Best regards, Dmi= trii Simonov.


------=_Part_9675474_1747640844.1424800924115--