Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1B18F200C8B for ; Mon, 22 May 2017 21:32:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 19C23160BBF; Mon, 22 May 2017 19:32:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6470E160BAD for ; Mon, 22 May 2017 21:32:10 +0200 (CEST) Received: (qmail 32092 invoked by uid 500); 22 May 2017 19:32:09 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 32073 invoked by uid 99); 22 May 2017 19:32:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 May 2017 19:32:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3AE1F190D38 for ; Mon, 22 May 2017 19:32:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id jrjoO6J--ZiQ for ; Mon, 22 May 2017 19:32:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id AC3345F2AB for ; Mon, 22 May 2017 19:32:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E064CE0C0F for ; Mon, 22 May 2017 19:32:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 486D321B5E for ; Mon, 22 May 2017 19:32:04 +0000 (UTC) Date: Mon, 22 May 2017 19:32:04 +0000 (UTC) From: "Sylvain Lebresne (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-8272) 2ndary indexes can return stale data MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 22 May 2017 19:32:11 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-8272?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 16020052#comment-16020052 ]=20 Sylvain Lebresne commented on CASSANDRA-8272: --------------------------------------------- I can refer you to [my comment on 8273|https://issues.apache.org/jira/brows= e/CASSANDRA-8273?focusedCommentId=3D16007964&page=3Dcom.atlassian.jira.plug= in.system.issuetabpanels:comment-tabpanel#comment-16007964] on that aspect = since it's largely the same aspect, but the short version is that you are r= ight, but at the same time 1) anyone caring about performance should probab= ly use token-aware clients and that make such CL.ONE optimization not reall= y needed, 2) we actually don't ship the consistency with {{ReadCommand}} to= replicas, so such optimization cannot be done before 4.0 at best (it requi= res a protocol change) and 3) the reason why this ticket is "easier" than C= ASSANDRA-8723 is that we will likely not transfer _that_ much additional ro= ws: we'll only sent row that use to be valid entries for the query but aren= 't anymore and this since less than gc_grace, which, except maybe for very = specific cases, is unlikely for represent a huge overhead for any particula= r query. Anyway, not really opposing such optimization, but given it's not useful if= you follow performance best practices and given it's a tiny bit more invol= ved than it sounds (and it adds a bit of complexity to the code after all b= y creating a special case), I'd be happy focusing on correction here and le= aving that to a follow-up.=20 > 2ndary indexes can return stale data > ------------------------------------ > > Key: CASSANDRA-8272 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8272 > Project: Cassandra > Issue Type: Bug > Reporter: Sylvain Lebresne > Assignee: Andr=C3=A9s de la Pe=C3=B1a > Fix For: 3.0.x > > > When replica return 2ndary index results, it's possible for a single repl= ica to return a stale result and that result will be sent back to the user,= potentially failing the CL contract. > For instance, consider 3 replicas A, B and C, and the following situation= : > {noformat} > CREATE TABLE test (k int PRIMARY KEY, v text); > CREATE INDEX ON test(v); > INSERT INTO test(k, v) VALUES (0, 'foo'); > {noformat} > with every replica up to date. Now, suppose that the following queries ar= e done at {{QUORUM}}: > {noformat} > UPDATE test SET v =3D 'bar' WHERE k =3D 0; > SELECT * FROM test WHERE v =3D 'foo'; > {noformat} > then, if A and B acknowledge the insert but C respond to the read before = having applied the insert, then the now stale result will be returned (sinc= e C will return it and A or B will return nothing). > A potential solution would be that when we read a tombstone in the index = (and provided we make the index inherit the gcGrace of it's parent CF), ins= tead of skipping that tombstone, we'd insert in the result a corresponding = range tombstone. =20 -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org