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 6C02017D11 for ; Tue, 19 May 2015 08:05:30 +0000 (UTC) Received: (qmail 38204 invoked by uid 500); 19 May 2015 08:05:27 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 38165 invoked by uid 500); 19 May 2015 08:05: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 38155 invoked by uid 99); 19 May 2015 08:05:27 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 May 2015 08:05:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 3F5B3C11BA for ; Tue, 19 May 2015 08:05:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=datastax.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id WB_uSgo8i7QF for ; Tue, 19 May 2015 08:05:18 +0000 (UTC) Received: from mail-qg0-f44.google.com (mail-qg0-f44.google.com [209.85.192.44]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 36A0F43CA7 for ; Tue, 19 May 2015 08:05:18 +0000 (UTC) Received: by qgde91 with SMTP id e91so3307242qgd.0 for ; Tue, 19 May 2015 01:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datastax.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=+bWt3g9uS9qWZXiYILBK3dUSdeS/6Ya7pTprqzYG01c=; b=jmDcP50sRf/jNWZW5V1pqVNh/h1jdcDC60kqsFy2tqGe/Lw4LY3y0PBngidW2+6tj0 IG9C8iN9r4+UOMRaranY3KA3olSxcwL2SPFhtsH0MQ2WFQAg9eNf4Vkj8AkBvaHnXMGP GTyBnyAUIFHFQyosSWyCnCdV6QiXoOMf1mU6k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=+bWt3g9uS9qWZXiYILBK3dUSdeS/6Ya7pTprqzYG01c=; b=BmXgqpPW4suKMCA9qA7MDb9D2u6Di8QM0x0M7k6xl5jWcNB3JNv1nxUjSqgTpu+DTP 93v9O0zqG/Yj+jpRMpdPBY011xkJbdoezFH6e0RSO2qFBuBbGfBY7l8++TKFPYYrEUVi bgI3DlEsDoXHVbOCDNr+6IRk9tZ4erAJmTmBi+5JV4E2j4blLSKQYD0FFIsA7an8hylV 1Hn+kY5ChN8r0brM86oLg3ikjJ1u5RopMBsaHDGmtF/Pyusj/tO6b11ATBl9ZFsS40bY Gv48bqiGgS1rH1Q86nwhp/EIo8Opq+mIc82p9RtW6JQZ6F7UbKjqNLasuhIgbq30x+Jb WmQg== X-Gm-Message-State: ALoCoQnJBYZll3f16EdalxtgRQGc0kI/1JRQHQrpigWdFW2r1VPeUwjD72Ozw37RdEM2Rns2M/Kr X-Received: by 10.229.84.70 with SMTP id i6mr35659959qcl.20.1432022712072; Tue, 19 May 2015 01:05:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.73.4 with HTTP; Tue, 19 May 2015 01:04:51 -0700 (PDT) In-Reply-To: References: <5559BFA7.1080108@googlemail.com> <555AD0DF.4040106@googlemail.com> From: Sylvain Lebresne Date: Tue, 19 May 2015 10:04:51 +0200 Message-ID: Subject: Re: Batch isolation within a single partition To: "user@cassandra.apache.org" Content-Type: multipart/alternative; boundary=001a1133c1ba10547405166ac541 --001a1133c1ba10547405166ac541 Content-Type: text/plain; charset=UTF-8 On Tue, May 19, 2015 at 9:42 AM, DuyHai Doan wrote: > If RF > 1, the consistency level at QUORUM cannot guarantee strict > isolation (for normal mutation or batch). If you look at this slide: > http://www.slideshare.net/doanduyhai/cassandra-introduction-apache-con-2014-budapest/25, > you can see that the mutation is sent by the coordinator, in parallel, to > all replicas. > > Now it is very possible that due to network latency, the mutation is > applied on the first replica and is applied with "some delay" (which can be > at the order of microseconds) on other replicas. > > Theoretically, one client can read updated value on first replica and old > value on the other replicas, even at QUORUM. > Unfortunately different people will tend to have different definitions of isolation and I don't seem to have the same definition than you but still, I don't understand what you're talking about. Of course replicas might not get a mutation at the same time, and yes, a read at QUORUM may thus not see the most up to date value from all replicas. But the coordinator resolves all responses together and return only the most recent one, so that doesn't matter to the client and I don't see how that has anything to do with isolation from the client perspective. My response to the original question is that if by isolation you mean "can a reader observe a write only partially applied", then for single partition writes, Cassandra do offer isolation. One caveat however is that if 2 writes conflits, they are resolved using their timestamp and if the timestamp are the same, resolution is based on values, which is not necessarily intuitive and may make it sound like the writes where not applied in isolation (even though technically they are), see https://issues.apache.org/jira/browse/CASSANDRA-6123 for details on that later problem. I'll note that my definition of isolation does not mean you can't read stale data, and you can indeed if you use weak consistency levels. If you mean something else by isolation, then I think agreeing first on the definition would be wise. -- Sylvain --001a1133c1ba10547405166ac541 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, May 19, 2015 at 9:42 AM, DuyHai Doan <doanduyh= ai@gmail.com> wrote:
If RF > 1, the consistency level at QUORUM cannot guarantee str= ict isolation (for normal mutation or batch). If you look at this slide:=C2= =A0http://www.slideshare.net/doa= nduyhai/cassandra-introduction-apache-con-2014-budapest/25, you can see= that the mutation is sent by the coordinator, in parallel, to all replicas= .

=C2=A0Now it is very possible that due to network late= ncy, the mutation is applied on the first replica and is applied with "= ;some delay" (which can be at the order of microseconds) on other repl= icas.

=C2=A0Theoretically, one client can read upd= ated value on first replica and old value on the other replicas, even at QU= ORUM.

Unfortunately different p= eople will tend to have different definitions of isolation and I don't = seem to have the same definition than you but still, I don't understand= what you're talking about. Of course replicas might not get a mutation= at the same time, and yes, a read at QUORUM may thus not see the most up t= o date value from all replicas. But the coordinator resolves all responses = together and return only the most recent one, so that doesn't matter to= the client and I don't see how that has anything to do with isolation = from the client perspective.

My response to the original = question is that if by isolation you mean "can a reader observe a writ= e only partially applied", then for single partition writes, Cassandra= do offer isolation. One caveat however is that if 2 writes conflits, they = are resolved using their timestamp and if the timestamp are the same, resol= ution is based on values, which is not necessarily intuitive and may make i= t sound like the writes where not applied in isolation (even though technic= ally they are), see https://issues.apache.org/jira/browse/CASSANDRA-6123 for deta= ils on that later problem. I'll note that my definition of isolation do= es not mean you can't read stale data, and you can indeed if you use we= ak consistency levels.

If you mean something else by isol= ation, then I think agreeing first on the definition would be wise.

= --
Sylvain
--001a1133c1ba10547405166ac541--