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 4A4DA200C67 for ; Mon, 15 May 2017 14:35:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 48CEB160BC1; Mon, 15 May 2017 12:35:10 +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 8FC4F160BC2 for ; Mon, 15 May 2017 14:35:09 +0200 (CEST) Received: (qmail 58057 invoked by uid 500); 15 May 2017 12:35:08 -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 57845 invoked by uid 99); 15 May 2017 12:35:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 May 2017 12:35:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id DF59FCF5AE for ; Mon, 15 May 2017 12:35:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id s0beckK4SJkA for ; Mon, 15 May 2017 12:35:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 09F8F5FE41 for ; Mon, 15 May 2017 12:35:06 +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 64CC5E0D8D for ; Mon, 15 May 2017 12:35:05 +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 79F0A2434C for ; Mon, 15 May 2017 12:35:04 +0000 (UTC) Date: Mon, 15 May 2017 12:35: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, 15 May 2017 12:35:10 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-8272?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 16010420#comment-16010420 ]=20 Sylvain Lebresne commented on CASSANDRA-8272: --------------------------------------------- Looks good to me. bq. for trunk, we could either remove the {{Index#customExpressionFor(CFMet= aData cfm, ByteBuffer value)}} implementation or keep it as an ease for ind= ex implementations not interested in or able of implementing the coordinato= r side part of this.=20 For what it's worth, I'd really remove it. The default we're providing is j= ust broken for any sensible index implementation, and have a default implem= entation that is intrinsically broken is wrong. Sure, so far we haven't rel= ied on that implementation, and with this ticket we would rely on it in a p= articular case only, but all this isn't very future proof. And there is no = real cost to asking custom index to implement it: worst case, they can just= making it always return true themselves if they so wish, but at least they= do it while being plainly aware that it's dodgy and could brake things in = the future. > 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