Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-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 D0DBF9D3C for ; Fri, 27 Jan 2012 07:52:55 +0000 (UTC) Received: (qmail 46867 invoked by uid 500); 27 Jan 2012 07:52:54 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 46422 invoked by uid 500); 27 Jan 2012 07:52:47 -0000 Mailing-List: contact hdfs-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-user@hadoop.apache.org Delivered-To: mailing list hdfs-user@hadoop.apache.org Received: (qmail 46412 invoked by uid 99); 27 Jan 2012 07:52:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jan 2012 07:52:42 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,T_FRT_BEFORE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jenvor@gmail.com designates 209.85.212.176 as permitted sender) Received: from [209.85.212.176] (HELO mail-wi0-f176.google.com) (209.85.212.176) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jan 2012 07:52:37 +0000 Received: by wibhq12 with SMTP id hq12so1446955wib.35 for ; Thu, 26 Jan 2012 23:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=QbJecluOW76g3jeoJ3lUMvxD4IR4wGRiHU8StoCjw0g=; b=iJaaJlGhtRWSis1ozTQecLnx7aMlvBlaMe6Thw81L/dvF1QQYr71gygy2tVzX7Modw 7ABzt2CmA78t0bCrot9/oPv9HPnD6Q5f+Sg8fM2buuN4/oSNz1bIRViG1091fNLt1Fdx PtJDCHgsOUo9A9LzlH1ky8TmTd5l2hiY5BKqU= MIME-Version: 1.0 Received: by 10.180.106.202 with SMTP id gw10mr12238316wib.3.1327650735929; Thu, 26 Jan 2012 23:52:15 -0800 (PST) Received: by 10.216.48.19 with HTTP; Thu, 26 Jan 2012 23:52:15 -0800 (PST) In-Reply-To: References: Date: Fri, 27 Jan 2012 02:52:15 -0500 Message-ID: Subject: Re: Replication is done synchronously or asynchronously? From: "Zhenhua (Gerald) Guo" To: hdfs-user@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks a lot! Your reply thoroughly cleared my confusion. Gerald On Fri, Jan 27, 2012 at 1:02 AM, Harsh J wrote: > Yes you're correct. > > Also note that sometimes the request may be for 3 replicas but > NameNode may only be able to grant lesser cause remaining DNs are > full/unreachable/loaded-with-threads, in which case write will work > with just the lesser amount of pipeline size, so long as its >=3D > dfs.replication.min. > > If it gets 0 assignments when requesting for a write, it runs into > this: wiki.apache.org/hadoop/FAQ#What_does_.22file_could_only_be_replicat= ed_to_0_nodes.2C_instead_of_1.22_mean.3F > > On Fri, Jan 27, 2012 at 4:53 AM, Zhenhua (Gerald) Guo = wrote: >> Thanks, Harsh J. =A0Your answer is quite helpful! >> If I understand right, writes wait until all replicas are created if >> there is no error during the replication process. =A0If there is any >> error in the replication pipeline, dfs.replication.min comes into play >> . =A0Is my understanding correct? >> >> Gerald >> >> On Thu, Jan 26, 2012 at 4:07 PM, Harsh J wrote: >>> Hi, >>> >>> On Fri, Jan 27, 2012 at 12:27 AM, Zhenhua (Gerald) Guo wrote: >>>> I have two questions regarding creation of replicas. >>>> - When a user uploads a file to HDFS, it returns whenever the first >>>> replica is created? or the client needs wait until all replicas are >>>> created? >>>> - When the output of MapReduce jobs is written to HDFS (by reduce >>>> tasks), the writing of output returns when the first replica is >>>> created? or wait until all replicas are created? >>> >>> Both questions are the same as both do the same form of DFS write. >>> >>> Writes are synchronous and replication is pipelined, presently in Apach= e Hadoop. >>> >>> But a write will succeed if at least 1 replica was written (controlled >>> via dfs.replication.min -- pipeline can lose DNs out of errors, or can >>> get fewer than requested DNs cause of load/space issues, but write >>> will succeed if it at least gets one DN) >>> >>> Also see the whole conversation at >>> http://search-hadoop.com/m/bF99W1ZmNqz1 for some more tidbits you >>> might find interesting. >>> >>> -- >>> Harsh J >>> Customer Ops. Engineer, Cloudera > > > > -- > Harsh J > Customer Ops. Engineer, Cloudera