Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 21854 invoked from network); 6 Apr 2010 07:11:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Apr 2010 07:11:55 -0000 Received: (qmail 73344 invoked by uid 500); 6 Apr 2010 07:11:54 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 73328 invoked by uid 500); 6 Apr 2010 07:11:54 -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 73320 invoked by uid 99); 6 Apr 2010 07:11:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Apr 2010 07:11:54 +0000 X-ASF-Spam-Status: No, hits=1.1 required=10.0 tests=AWL,FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of prescod@gmail.com designates 74.125.83.44 as permitted sender) Received: from [74.125.83.44] (HELO mail-gw0-f44.google.com) (74.125.83.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Apr 2010 07:11:48 +0000 Received: by gwj20 with SMTP id 20so1449809gwj.31 for ; Tue, 06 Apr 2010 00:11:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:from:date :received:message-id:subject:to:content-type; bh=kFD2wz7gUieq37Wkz/XHaGehoATHAaRDVb0FJU4NuaQ=; b=rmPfiyqqbd8QibuK3h7R6ZLm1kI1gwzJBrkLcmmOL45ANTEGz3YJVk5tmwFR5A5wps e7vAHQp+0rzfwkiFyhv8oB/N85XuLlgUB56qvpIqQERrOc6Xa7CMHdacHPIDhgzY5LWY Mo5Ab97E+El7/yq9JD0fk0HPtnYMaSUhBIgcs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:from:date:message-id:subject:to:content-type; b=sxykpI7Yu5kwgNJOO5mzba0NrCXOQUAZvofpA7xTBJ/VwuVNrU374GqB3N7xe/UP9G uSbwzn+AiytVTlh4rjS6EIbIAWL7/HJdrITSpFDCPPZ0Zi6hBBwwZDOnw1HYkFqWHlJS 1H67Z/3wN180Wou+rCQZOcKwmnROkc9+SCGpk= MIME-Version: 1.0 Received: by 10.100.231.17 with HTTP; Tue, 6 Apr 2010 00:11:04 -0700 (PDT) Reply-To: paul@prescod.net From: Paul Prescod Date: Tue, 6 Apr 2010 00:11:04 -0700 Received: by 10.101.28.5 with SMTP id f5mr12711946anj.35.1270537884712; Tue, 06 Apr 2010 00:11:24 -0700 (PDT) Message-ID: Subject: How do vector clocks and conflicts work? To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=001636b2b1624afe5f04838c2730 --001636b2b1624afe5f04838c2730 Content-Type: text/plain; charset=UTF-8 This may be the blind leading the blind... On Mon, Apr 5, 2010 at 11:54 PM, Tatu Saloranta wrote: >... > I think the key is that this is not automatic -- there is no general > mechanism for aggregating distinct modifications. Point being that you > could choose one amongst right answers, but not what to do with > concurrent modifications. So what is done instead is have > application-specific resolution strategy which makes use of semantics > of operations, to know how to combine such concurrent modifications > into "correct" answer. I agree with all of that. > I don't know if this is trivial for case of > counter increments: especially since two concurrent increments give > same new value; yet correct combined result would be one higher (both > used base, added one). > As long as the conflict resolver knows that two writers each tried to increment, then it can increment twice. The conflict resolver must know about the semantics of "increment" or "decrement" or "string append" or "binary patch" or whatever other merge strategy you choose. You'll register your "strategy" with Cassandra and it will apply it. Presumably it will also maintain enough context about what you were trying to accomplish to allow the merge strategy plugin to do it properly. > That is to say, my understanding was that vector clocks would be > required but not sufficient for reconciliation of concurrent value > updates. > I agree. They are necessary, but not sufficient. The other half is the "merge strategy plugin" thing, which is analogous to custom comparators in Cassandra today. In CASSANDRA-580, Pedro Gomes talks about the plugins like this: "I suppose for the beginning of the discussion that some sort of interface will be implemented to allow pluggable logic to be added to the server, personalized scripts were an idea, I have heard. " Kevin Kakugawa replies that they'll just use Java class libraries as a first pass. Paul Prescod --001636b2b1624afe5f04838c2730 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This may be the blind leading the blind...

On Mon,= Apr 5, 2010 at 11:54 PM, Tatu Saloranta <tsaloranta@gmail.com> wrote:
<= div class=3D"gmail_quote">
>...
=C2=A0
I think the key is that this is not automatic -- there is no ge= neral
mechanism for aggregating distinct modifications. Point being that you
could choose one amongst right answers, but not what to do with
concurrent modifications. So what is done instead is have
application-specific resolution strategy which makes use of semantics
of operations, to know how to combine such concurrent modifications
into "correct" answer.

I agree w= ith all of that.
=C2=A0
I do= n't know if this is trivial for case of
counter increments: especially since two concurrent increments give
same new value; yet correct combined result would be one higher (both
used base, added one).

As long as the c= onflict resolver knows that two writers each tried to increment, then it ca= n increment twice. The conflict resolver must know about the semantics of &= quot;increment" or "decrement" or "string append" = or "binary patch" or whatever other merge strategy you choose. Yo= u'll register your "strategy" with Cassandra and it will appl= y it. Presumably it will also maintain enough context about what you were t= rying to accomplish to allow the merge strategy plugin to do it properly.
=C2=A0
That is to say, my understanding was that vector clocks would be
required but not sufficient for reconciliation of concurrent value
updates.

I agree. They are necessary, b= ut not sufficient. The other half is the "merge strategy plugin" = thing, which is analogous to custom comparators in Cassandra today.

In CASSANDRA-580, Pedro Gomes talks about the plugins l= ike this: "I suppose for = the beginning of the discussion that some sort of interface will be impleme= nted to allow pluggable logic to be added to the server, personalized scrip= ts were an idea, I have heard. "

Kevin Kakugawa replies that they&= #39;ll just use Java class libraries as a first pass.
=C2=A0
=C2=A0Paul Prescod


--001636b2b1624afe5f04838c2730--