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 E4AB4200C45 for ; Tue, 28 Mar 2017 12:07:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E328B160B89; Tue, 28 Mar 2017 10:07:46 +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 0E105160B7E for ; Tue, 28 Mar 2017 12:07:45 +0200 (CEST) Received: (qmail 15180 invoked by uid 500); 28 Mar 2017 10:07:45 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 15169 invoked by uid 99); 28 Mar 2017 10:07:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2017 10:07:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CA0BA1A079C for ; Tue, 28 Mar 2017 10:07:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, 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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 5s_4ABa6Hx41 for ; Tue, 28 Mar 2017 10:07:43 +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 9D6DC5FE3F for ; Tue, 28 Mar 2017 10:07:42 +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 CF9EEE042C for ; Tue, 28 Mar 2017 10:07:41 +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 87CE025CDC for ; Tue, 28 Mar 2017 10:07:41 +0000 (UTC) Date: Tue, 28 Mar 2017 10:07:41 +0000 (UTC) From: "Benjamin Lerer (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-13277) Duplicate results with secondary index on static column MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 28 Mar 2017 10:07:47 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13277?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D15944905#comment-15944905 ]=20 Benjamin Lerer commented on CASSANDRA-13277: -------------------------------------------- Nice finding! The patch looks good. Thanks. > Duplicate results with secondary index on static column > ------------------------------------------------------- > > Key: CASSANDRA-13277 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1327= 7 > Project: Cassandra > Issue Type: Bug > Reporter: Romain Hardouin > Assignee: Andr=C3=A9s de la Pe=C3=B1a > Labels: 2i > > As a follow up of http://www.mail-archive.com/user@cassandra.apache.org/m= sg50816.html=20 > Duplicate results appear with secondary index on static column with RF > = 1. > Number of results vary depending on consistency level. > Here is a CCM session to reproduce the issue: > {code} > romain@debian:~$ ccm create 39 -n 3 -v 3.9 -s > Current cluster is now: 39 > romain@debian:~$ ccm node1 cqlsh > Connected to 39 at 127.0.0.1:9042. > [cqlsh 5.0.1 | Cassandra 3.9 | CQL spec 3.4.2 | Native protocol v4] > Use HELP for help. > cqlsh> CREATE KEYSPACE test WITH replication =3D {'class': 'SimpleStrateg= y', 'replication_factor': 2}; > cqlsh> CREATE TABLE test.idx_static (id text, id2 bigint static, added ti= mestamp, source text static, dest text, primary key (id, added)); > cqlsh> CREATE index ON test.idx_static (id2); > cqlsh> INSERT INTO test.idx_static (id, id2, added, source, dest) values = ('id1', 22,'2017-01-28', 'src1', 'dst1'); > cqlsh> SELECT * FROM test.idx_static where id2=3D22; > id | added | id2 | source | dest > -----+---------------------------------+-----+--------+------ > id1 | 2017-01-27 23:00:00.000000+0000 | 22 | src1 | dst1 > id1 | 2017-01-27 23:00:00.000000+0000 | 22 | src1 | dst1 > (2 rows) > cqlsh> CONSISTENCY ALL=20 > Consistency level set to ALL. > cqlsh> SELECT * FROM test.idx_static where id2=3D22; > id | added | id2 | source | dest > -----+---------------------------------+-----+--------+------ > id1 | 2017-01-27 23:00:00.000000+0000 | 22 | src1 | dst1 > id1 | 2017-01-27 23:00:00.000000+0000 | 22 | src1 | dst1 > id1 | 2017-01-27 23:00:00.000000+0000 | 22 | src1 | dst1 > (3 rows) > {code} > When RF matches the number of nodes, it works as expected. > Example with RF=3D3 and 3 nodes: > {code} > romain@debian:~$ ccm create 39 -n 3 -v 3.9 -s > Current cluster is now: 39 > romain@debian:~$ ccm node1 cqlsh > Connected to 39 at 127.0.0.1:9042. > [cqlsh 5.0.1 | Cassandra 3.9 | CQL spec 3.4.2 | Native protocol v4] > Use HELP for help. > cqlsh> CREATE KEYSPACE test WITH replication =3D {'class': 'SimpleStrateg= y', 'replication_factor': 3}; > cqlsh> CREATE TABLE test.idx_static (id text, id2 bigint static, added ti= mestamp, source text static, dest text, primary key (id, added)); > cqlsh> CREATE index ON test.idx_static (id2); > cqlsh> INSERT INTO test.idx_static (id, id2, added, source, dest) values = ('id1', 22,'2017-01-28', 'src1', 'dst1'); > cqlsh> SELECT * FROM test.idx_static where id2=3D22; > id | added | id2 | source | dest > -----+---------------------------------+-----+--------+------ > id1 | 2017-01-27 23:00:00.000000+0000 | 22 | src1 | dst1 > (1 rows) > cqlsh> CONSISTENCY all > Consistency level set to ALL. > cqlsh> SELECT * FROM test.idx_static where id2=3D22; > id | added | id2 | source | dest > -----+---------------------------------+-----+--------+------ > id1 | 2017-01-27 23:00:00.000000+0000 | 22 | src1 | dst1 > (1 rows) > {code} > Example with RF =3D 2 and 2 nodes: > {code} > romain@debian:~$ ccm create 39 -n 2 -v 3.9 -s > Current cluster is now: 39 > romain@debian:~$ ccm node1 cqlsh > Connected to 39 at 127.0.0.1:9042. > [cqlsh 5.0.1 | Cassandra 3.9 | CQL spec 3.4.2 | Native protocol v4] > Use HELP for help. > cqlsh> CREATE KEYSPACE test WITH replication =3D {'class': 'SimpleStrateg= y', 'replication_factor': 2}; > cqlsh> CREATE TABLE test.idx_static (id text, id2 bigint static, added ti= mestamp, source text static, dest text, primary key (id, added)); > cqlsh> INSERT INTO test.idx_static (id, id2, added, source, dest) values = ('id1', 22,'2017-01-28', 'src1', 'dst1'); > cqlsh> CREATE index ON test.idx_static (id2); > cqlsh> INSERT INTO test.idx_static (id, id2, added, source, dest) values = ('id1', 22,'2017-01-28', 'src1', 'dst1'); > cqlsh> SELECT * FROM test.idx_static where id2=3D22; > id | added | id2 | source | dest > -----+---------------------------------+-----+--------+------ > id1 | 2017-01-27 23:00:00.000000+0000 | 22 | src1 | dst1 > (1 rows) > cqlsh> CONSISTENCY ALL=20 > Consistency level set to ALL. > cqlsh> SELECT * FROM test.idx_static where id2=3D22; > id | added | id2 | source | dest > -----+---------------------------------+-----+--------+------ > id1 | 2017-01-27 23:00:00.000000+0000 | 22 | src1 | dst1 > (1 rows) > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)