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 0BA9774C0 for ; Fri, 22 Jul 2011 16:28:16 +0000 (UTC) Received: (qmail 15529 invoked by uid 500); 22 Jul 2011 16:28:13 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 15048 invoked by uid 500); 22 Jul 2011 16:28:13 -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 14599 invoked by uid 99); 22 Jul 2011 16:28:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2011 16:28:12 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [202.38.128.6] (HELO ihep.ac.cn) (202.38.128.6) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 22 Jul 2011 16:28:06 +0000 Received: from [128.141.138.230] (unknown [128.141.138.230]) by mail.ihep.ac.cn (Coremail) with SMTP id fwD__pD76TX4pClOwM9qAA--.36371S2; Sat, 23 Jul 2011 00:27:37 +0800 (CST) Message-ID: <4E29A50C.9080903@ihep.ac.cn> Date: Fri, 22 Jul 2011 18:27:56 +0200 From: Donal Zang Reply-To: zangds@ihep.ac.cn Organization: IHEP User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: user@cassandra.apache.org Subject: Re: [SPAM] Fwd: Counter consistency - are counters idempotent? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: fwD__pD76TX4pClOwM9qAA--.36371S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUUYxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJ3UbIYCTnIWIevJa73UjIFyTuYvj4RJUUUUUUUU X-CM-SenderInfo: p2dqwvvv6lxvnsoduhdfq/ X-Virus-Checked: Checked by ClamAV on apache.org On 22/07/2011 18:08, Yang wrote: > btw, this "issue" of not knowing whether a write is persisted or not > when client reports error, is not limited to counters, for regular > columns, it's the same: if client reports write failure, the value may > well be replicated to all replicas later. this is even the same with > all other systems: Zookeeper, Paxos, ultimately due to the FLP > theoretical result of "no guarantee of consensus in async systems" yes, but with regular columns, retry is OK, while counter is not. > > ---------- Forwarded message ---------- > From: Sylvain Lebresne > Date: Fri, Jul 22, 2011 at 8:03 AM > Subject: Re: Counter consistency - are counters idempotent? > To: user@cassandra.apache.org > > > On Fri, Jul 22, 2011 at 4:52 PM, Kenny Yu wrote: >> As of Cassandra 0.8.1, are counter increments and decrements idempotent? If, >> for example, a client sends an increment request and the increment occurs, >> but the network subsequently fails and reports a failure to the client, will >> Cassandra retry the increment (thus leading to an overcount and inconsistent >> data)? >> I have done some reading and I am getting conflicting sources about counter >> consistency. In this source >> (http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/clarification-of-the-consistency-guarantees-of-Counters-td6421010.html), >> it states that counters now have the same consistency as regular >> columns--does this imply that the above example will not lead to an >> overcount? > That email thread was arguably a bit imprecise with its use of the > word 'consistency' > but what it was talking about is really consistency level. That is, counter > supports all the usual consistency levels (ONE, QUORUM, ALL, LOCAL_QUORUM, > EACH_QUORUM) excepted ANY. > Counter are still not idempotent. And just a small precision, if you > get a TimeoutException, > Cassandra never retry the increment on it's own (your sentence > suggests it does), > but you won't know in that case if the increment was persisted or not, > and thus you > won't know if you should retry or not. And yes, this is still a > limitation of counters. > > >> If counters are not idempotent, are there examples of effective uses of >> counters that will prevent inconsistent counts? >> Thank you for your help. -- Donal Zang Computing Center, IHEP 19B YuquanLu, Shijingshan District,Beijing, 100049 zangds@ihep.ac.cn 86 010 8823 6018