Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7736CD697 for ; Fri, 17 Aug 2012 14:28:29 +0000 (UTC) Received: (qmail 97326 invoked by uid 500); 17 Aug 2012 14:28:27 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 97302 invoked by uid 500); 17 Aug 2012 14:28:27 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 97290 invoked by uid 99); 17 Aug 2012 14:28:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2012 14:28:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of coolmohitz@gmail.com designates 209.85.212.172 as permitted sender) Received: from [209.85.212.172] (HELO mail-wi0-f172.google.com) (209.85.212.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2012 14:28:19 +0000 Received: by wicr5 with SMTP id r5so1285603wic.7 for ; Fri, 17 Aug 2012 07:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=t5Ym8EfEO3u+0YiGchvPXjzFzrNNBoxsDaN+eh84koE=; b=HJi4E0AM7z0AJhJw2cUL0NknmmTu3wTwsgbwiuhIqf88NRVmVkAqf7K1HHsAmP0L59 nIGiWQ3uNqsnKket9IgFhl2yG4KMLPGrwaIGGlxXQw0an26R3irKIKhAkvwTsZLYQNou +XDQ31LQMdAL+yjAduoSjVrYdCSW4yiKc1FfruVzig4xrKPBIGO7yZpzuHIUwVs8ggwe WvXszx/l3aLAcBj+wCJAn3fE3JkK5YJUSAkzkDJdXQdA+0vgtZqQK5qfP4J25oSJ27KE i4Ala2j8Tyw17yXhFZfWyjIa8cWQHMM2JN/w4BEIlE9F14kCYuwRJWBu4LPu3FWetAMc uECA== MIME-Version: 1.0 Received: by 10.180.105.6 with SMTP id gi6mr5589850wib.4.1345213679089; Fri, 17 Aug 2012 07:27:59 -0700 (PDT) Received: by 10.216.101.2 with HTTP; Fri, 17 Aug 2012 07:27:59 -0700 (PDT) In-Reply-To: References: Date: Fri, 17 Aug 2012 19:57:59 +0530 Message-ID: Subject: Re: Understanding UnavailableException From: Mohit Agarwal To: user@cassandra.apache.org, mac.miklas@gmail.com Content-Type: multipart/alternative; boundary=f46d04428cc87d397d04c776f77a --f46d04428cc87d397d04c776f77a Content-Type: text/plain; charset=ISO-8859-1 Does this mean that the coordinator sends requests to all nodes, even when it knows that sufficient number of nodes are not available, via gossip? On Fri, Aug 17, 2012 at 4:49 PM, Maciej Miklas wrote: > UnavailableException is bit tricky. It means, that not all replicas > required by CL received update. Actually you do not know, whenever update > was stored or not, and actually what went wrong. > > This is the case, why writing with CL.ALL might get problematic. It is > enough, that only one replica is off-line and you will get exception. > Remember also, that CL.ALL means, all replicas in all Data Centers - not > only local DC. Writing with QUORUM_LOCAL could be better idea. > > There is only one CL, where exception guarantees, that data was really not > stored: CL.ANY with hinted handoff enabled. > > One more thing: write goes always to all replicas independent from > provided CL. Client request blocks only until required replicas respond - > however this response is asynchronous. This means, when you write with > lower CL, replicas will get data with the same speed, only your client does > not wait for acknowledgment from all of them. > > Ciao, > Maciej > > > > On Fri, Aug 17, 2012 at 11:07 AM, Mohit Agarwal wrote: > >> Hi guys, >> >> I am trying to understand what happens when an UnavailableException is >> thrown. >> >> a) Suppose we are doing a ConsistencyLevel.ALL write on a 3 node cluster. >> My understanding is that if one of the nodes is down and the coordinator >> node is aware of that(through gossip), then it will respond to the request >> with an UnavailableException. Is this correct? >> >> b) What happens if the coordinator isn't aware of a node being down and >> sends the request to all the nodes and never hears back from one of the >> node. Would this result in a TimedOutException or a UnavailableException? >> >> c) I am trying to understand the cases where the client receives an >> error, but data could have been inserted into Cassandra. One such case is >> the TimedOutException. Are there any other situations like these? >> >> Thanks, >> Mohit >> > > --f46d04428cc87d397d04c776f77a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Does this mean that the coordinator sends requests to all nodes, even when = it =A0knows that sufficient number of nodes are not available, via gossip?<= div>
On Fri, Aug 17, 2012 at 4:49 PM, Maciej = Miklas <mac.miklas@gmail.com> wrote:
UnavailableException is bit tricky. It means= , that not all replicas required by CL received update. Actually you do not= know, whenever update was stored or not, and actually what went wrong.

This is the case, why writing with CL.ALL might get problematic. It is = enough, that only one replica is off-line and you will get exception. Remem= ber also, that CL.ALL means, all replicas in all Data Centers - not only lo= cal DC. Writing with QUORUM_LOCAL could be better idea.

There is only one CL, where exception guarantees, that data was really = not stored: CL.ANY with hinted handoff enabled.

One more thing: writ= e goes always to all replicas independent from provided CL. Client request = blocks only until required replicas respond - however this response is asyn= chronous. This means, when you write with lower CL, replicas will get data = with the same speed, only your client does not wait for acknowledgment from= all of them.

Ciao,
Maciej



On Fri, Aug 17, 2012 at 11:07 AM, Mohit Agarwal <coolmohitz@gmail.com> wrote:
Hi guys,=A0

I am trying t= o understand what happens when an UnavailableException is thrown.=A0
<= div>
a) Suppose we are doing a ConsistencyLevel.ALL write on a 3 = node cluster. My understanding is that if one of the nodes is down and the = coordinator node is aware of that(through gossip), then it will respond to = the request with an UnavailableException. Is this correct?

b) What happens if the coordinator isn't aware of a= node being down and sends the request to all the nodes and never hears bac= k from one of the node. Would this result in a TimedOutException or a Unava= ilableException?=A0

c) I am trying to understand the cases where the client= receives an error, but data could have been inserted into Cassandra. One s= uch case is the TimedOutException. Are there any other situations like thes= e?=A0

Thanks,
Mohit


--f46d04428cc87d397d04c776f77a--