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 831897A1A for ; Mon, 7 Nov 2011 16:09:51 +0000 (UTC) Received: (qmail 1347 invoked by uid 500); 7 Nov 2011 16:09:49 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 1326 invoked by uid 500); 7 Nov 2011 16:09:49 -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 1318 invoked by uid 99); 7 Nov 2011 16:09:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2011 16:09:49 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of arodrime@gmail.com designates 209.85.215.172 as permitted sender) Received: from [209.85.215.172] (HELO mail-ey0-f172.google.com) (209.85.215.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2011 16:09:42 +0000 Received: by eyg24 with SMTP id 24so4082677eyg.31 for ; Mon, 07 Nov 2011 08:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=/zwz9Uv5QvjTS4w6xRUfra6OzVBzwb09lobrbeDdwKU=; b=Nh+Wo7biFhpH8gQkkD8BrPznFJWAB+vb4dO4hVuwbAN1/Czui4LQVZFi8oQgsDk+HX 5a7zrWWis57gOe9lWMoCoO7fICxmKO/kr6ShNWWnbeWEePplS9THdKndlPHs45wXNBdc hgjVt0f4e+pjumBxxnMXj0hIOI1mkm9ZuURvM= Received: by 10.213.35.199 with SMTP id q7mr1082276ebd.5.1320682161118; Mon, 07 Nov 2011 08:09:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.35.73 with HTTP; Mon, 7 Nov 2011 08:09:00 -0800 (PST) In-Reply-To: References: From: Alain RODRIGUEZ Date: Mon, 7 Nov 2011 17:09:00 +0100 Message-ID: Subject: Re: Counters and replication factor To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0015174c0e40131ca704b127479f --0015174c0e40131ca704b127479f Content-Type: text/plain; charset=ISO-8859-1 I've tried with CL.All, but it doesn't wotk better. I still have strange values (between 4 and 10 events counted instead of 10) but know every request returns me always the same count value... It's very strange. Any other idea ? Alain 2011/11/7 Riyad Kalla > Alain, > > Try using a CL of 3 or "ALL" and see if that the problem goes away. > > Your replication factor (as I just learned) dictates how many nodes each > piece of data is replicated to; by using a RF of 3 you are saying > "replicate all my data to all my nodes" (in this case counters). > > This doesn't happen immediately, but you can *force* it to happen on write > by specifying a CL of "ALL". If you specify "1" then your counter value is > written to one member of the ring, then your command returns. > > If you keep querying you will bounce around your ring, reading the values > from the different nodes until a future date at *which point* all the > values will likely agree. > > If you keep all your code you have now exactly the same, just change the > code at the end where you read the counter value back, to keep reading the > counter value back every second for 60 seconds and see if all the values > eventually match up -- they should (as the counter value is replicated to > all the nodes and their old values discarded). > > -R > > > On Mon, Nov 7, 2011 at 8:15 AM, Alain RODRIGUEZ wrote: > >> Hi, >> >> I trying to switch from a RF = 1 to a RF = 3, but I get wrong values from >> counters when doing so... >> >> I got a CF that contains many counters of some events. When I'm at RF = 1 >> and simulate 10 events, they are well counted. >> However, when I switch to a RF = 3, my counter show a wrong value that >> sometimes change when requested twice (it can return 7, then 5 instead of >> 10 all the time). >> >> I first thought that it was a problem of CL because I seem to remember >> that I read once that I had to use CL.One for reads and writes with >> counters. So I tried with CL.One, without success... >> >> What am I doing wrong ? Is that some precaution to take when replicating >> counters ? >> >> Alain >> > > --0015174c0e40131ca704b127479f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I've tried with CL.All, but it doesn't wotk better. I still have st= range values (between 4 and 10 events counted instead of 10) but know every= request returns me always the same count value...

It= 9;s very strange.

Any other idea ?

Alain

=
2011/11/7 Riyad Kalla <rkalla@gmail.com>
Alain,

Try using a CL of 3 or "ALL" and see if= that the problem goes away.

Your replication fact= or (as I just learned) dictates how many nodes each piece of data is replic= ated to; by using a RF of 3 you are saying "replicate all my data to a= ll my nodes" (in this case counters).

This doesn't happen immediately, but you can *force= * it to happen on write by specifying a CL of "ALL". If you speci= fy "1" then your counter value is written to one member of the ri= ng, then your command returns.

If you keep querying you will bounce around your ring, = reading the values from the different nodes until a future date at *which p= oint* all the values will likely agree.

If you kee= p all your code you have now exactly the same, just change the code at the = end where you read the counter value back, to keep reading the counter valu= e back every second for 60 seconds and see if all the values eventually mat= ch up -- they should (as the counter value is replicated to all the nodes a= nd their old values discarded).


--0015174c0e40131ca704b127479f--