Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 22635 invoked from network); 17 Apr 2011 17:04:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Apr 2011 17:04:16 -0000 Received: (qmail 8598 invoked by uid 500); 17 Apr 2011 17:04:11 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 8546 invoked by uid 500); 17 Apr 2011 17:04:11 -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 8113 invoked by uid 99); 17 Apr 2011 17:04:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Apr 2011 17:04:11 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [128.2.11.95] (HELO smtp.andrew.cmu.edu) (128.2.11.95) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Apr 2011 17:04:06 +0000 Received: from [192.168.2.6] (c-71-206-238-245.hsd1.pa.comcast.net [71.206.238.245]) (user=jcipar mech=PLAIN (0 bits)) by smtp.andrew.cmu.edu (8.14.4/8.14.4) with ESMTP id p3HH3es0017591 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Sun, 17 Apr 2011 13:03:44 -0400 From: James Cipar Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/alternative; boundary=Apple-Mail-1-482589248 Subject: Re: Consistency model Date: Sun, 17 Apr 2011 13:03:39 -0400 In-Reply-To: To: user@cassandra.apache.org References: <8747B84D-8AAB-4DDB-A4B5-215EC7962B03@cmu.edu> <64E44C90-0AAB-40E3-B972-FD94C3D6C02F@cmu.edu> <86974EFE-F65B-47DB-86E7-0BDEB24E65FB@cmu.edu> <1288264559807268502@unknownmsgid> Message-Id: <2E90DAF5-139C-4834-9780-5A121F479440@cmu.edu> X-Mailer: Apple Mail (2.1084) X-PMX-Version: 5.5.9.388399, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.4.17.165417 X-SMTP-Spam-Clean: 9% ( HTML_NO_HTTP 0.1, LEO_OBFU_SUBJ_RE 0.1, SUPERLONG_LINE 0.05, BODYTEXTH_SIZE_10000_LESS 0, CTYPE_MULTIPART_NO_QUOTE 0, FROM_EDU_TLD 0, RDNS_BROADBAND 0, RDNS_GENERIC_POOLED 0, RDNS_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_GENERIC 0, RDNS_SUSP_SPECIFIC 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __C230066_P5 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_ALT 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __HAS_HTML 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_HTML 0, __MIME_VERSION 0, __MIME_VERSION_APPLEMAIL 0, __MSGID_APPLEMAIL 0, __RDNS_BROADBAND_5 0, __RDNS_POOLED_11 0, __SANE_MSGID 0, __TAG_EXISTS_HTML 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __USER_AGENT_APPLEMAIL 0, __X_MAILER_APPLEMAIL 0) X-SMTP-Spam-Score: 9% X-Scanned-By: MIMEDefang 2.60 on 128.2.11.95 --Apple-Mail-1-482589248 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > For a second, I thought this thread was saying I could see value(s) < = new value(s) within the same process on the second read at quorum That's exactly what I'm saying. Within a single process I see this = behavior, when reading with consistency_level=3DQUORUM Read value 1 Read value 2 Read value 1 # uh oh! we've gone backwards On Apr 17, 2011, at 12:15 PM, William Oberman wrote: > Cool, that is exactly what I was thinking/expecting, and I feel better = about the assumptions I've used in my refactor to move from MySQL -> = cassandra. =20 >=20 > I basically gave up on trying to force my code to assume (even at = quorum):=20 > -read value(s) for key from cassandra > -update/add/delete columns for key in memory based on value(s) > -write new value(s) for key to cassandra > That the next read for key in the same process would be equal to the = new value(s). But I do assume I read value(s) >=3D the new value(s). Of = course, in another process, I don't assume anything (e.g. my application = is ok reading the same state A in two processes and updating the state = to either B or C. I figured that's the best a distributed algorithm = could do without a "test and set" operation). >=20 > For a second, I thought this thread was saying I could see value(s) < = new value(s) within the same process on the second read at quorum, which = would have been bad for me. But this thread is not saying that, so I'm = still happy with cassandra :-)=20 >=20 > will >=20 > On Sun, Apr 17, 2011 at 11:24 AM, Milind Parikh = wrote: > William=20 > The issue is regarding whether you will see A or B; with any guarantee = of either. The discussion implies no; until the QW is complete. >=20 > /*********************** > sent from my android...please pardon occasional typos as I respond @ = the speed of thought > ************************/ >=20 >=20 >> On Apr 17, 2011 7:48 AM, "William Oberman" = wrote: >>=20 >> I'm pretty new to all of this, and I'm in the process of building my = mental model of Cassandra, but I'm still feeling better about this = thread. The way I figure it: >> 1. I'm trying to mutate the state of a key's column from A to B from = a thread somewhere (quorum) >> 2. I'm trying to read the state of a key from a thread somewhere else = (quorum) >>=20 >> If #1 succeeds I'm guaranteed to see B. If #1 fails (with an = exception) I'll see either A or B. I think I was concerned about that, = and wanted to see A in #2 until success in #1. But, I wanted to get to = state B, and if #1 retries until guaranteed success, do I care if I set = B earlier than I expected? I'm thinking no.=20 >>=20 >> I guess in terms of distributed algorithms/reasoning about systems, = I'm feeling ok with this level of guarantee (again, given the failed = write tells the client code of the undefined state).=20 >>=20 >>=20 >>=20 >> On Apr 17, 2011, at 10:10 AM, James Cipar wrote: >>=20 >> > I'm pretty new to Cassandra, ... >>=20 >=20 >=20 >=20 >=20 > --=20 > Will Oberman > Civic Science, Inc. > 3030 Penn Avenue., First Floor > Pittsburgh, PA 15201 > (M) 412-480-7835 > (E) oberman@civicscience.com --Apple-Mail-1-482589248 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii > For a second, I thought this thread was saying I could see value(s) < new value(s) within the same process on the second read at quorum

That's exactly what I'm saying.  Within a single process I see this behavior, when reading with consistency_level=QUORUM

Read value 1
Read value 2
Read value 1  # uh oh!  we've gone backwards



On Apr 17, 2011, at 12:15 PM, William Oberman wrote:

Cool, that is exactly what I was thinking/expecting, and I feel better about the assumptions I've used in my refactor to move from MySQL -> cassandra.  

I basically gave up on trying to force my code to assume (even at quorum): 
-read value(s) for key from cassandra
-update/add/delete columns for key in memory based on value(s)
-write new value(s) for key to cassandra
That the next read for key in the same process would be equal to the new value(s).  But I do assume I read value(s) >= the new value(s). Of course, in another process, I don't assume anything (e.g. my application is ok reading the same state A in two processes and updating the state to either B or C.  I figured that's the best a distributed algorithm could do without a "test and set" operation).

For a second, I thought this thread was saying I could see value(s) < new value(s) within the same process on the second read at quorum, which would have been bad for me.  But this thread is not saying that, so I'm still happy with cassandra :-) 

will

On Sun, Apr 17, 2011 at 11:24 AM, Milind Parikh <milindparikh@gmail.com> wrote:

William
The issue is regarding whether you will see A or B; with any guarantee of either. The discussion implies no; until the QW is complete.

/***********************
sent from my android...please pardon occasional typos as I respond @ the speed of thought
************************/


On Apr 17, 2011 7:48 AM, "William Oberman" <oberman@civicscience.com> wrote:

I'm pretty new to all of this, and I'm in the process of building my mental model of Cassandra, but I'm still feeling better about this thread. The way I figure it:
1. I'm trying to mutate the state of a key's column from A to B from a thread somewhere (quorum)
2. I'm trying to read the state of a key from a thread somewhere else (quorum)

If #1 succeeds I'm guaranteed to see B. If #1 fails (with an exception) I'll see either A or B. I think I was concerned about that, and wanted to see A in #2 until success in #1.  But, I wanted to get to state B, and if #1 retries until guaranteed success, do I care if I set B earlier than I expected?  I'm thinking no. 

I guess in terms of distributed algorithms/reasoning about systems, I'm feeling ok with this level of guarantee (again, given the failed write tells the client code of the undefined state). 



On Apr 17, 2011, at 10:10 AM, James Cipar <jcipar@cmu.edu> wrote:

> I'm pretty new to Cassandra, ...





--
Will Oberman
Civic Science, Inc.
3030 Penn Avenue., First Floor
Pittsburgh, PA 15201
(M) 412-480-7835
(E) oberman@civicscience.com

--Apple-Mail-1-482589248--