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 1DCAD200C72 for ; Thu, 6 Apr 2017 22:27:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1C7CD160B81; Thu, 6 Apr 2017 20:27:48 +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 61967160B9F for ; Thu, 6 Apr 2017 22:27:47 +0200 (CEST) Received: (qmail 29734 invoked by uid 500); 6 Apr 2017 20:27:46 -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 29641 invoked by uid 99); 6 Apr 2017 20:27:45 -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; Thu, 06 Apr 2017 20:27:45 +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 1D27AC0B41 for ; Thu, 6 Apr 2017 20:27:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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-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 uWVlXpCHcxFz for ; Thu, 6 Apr 2017 20:27:44 +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 192C05FBC1 for ; Thu, 6 Apr 2017 20:27:44 +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 58581E0D34 for ; Thu, 6 Apr 2017 20:27:43 +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 6E8292408F for ; Thu, 6 Apr 2017 20:27:42 +0000 (UTC) Date: Thu, 6 Apr 2017 20:27:42 +0000 (UTC) From: "Joshua McKenzie (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-13302) last row of previous page == first row of next page while querying data using SASI index MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 06 Apr 2017 20:27:48 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13302?page=3Dcom.atl= assian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joshua McKenzie updated CASSANDRA-13302: ---------------------------------------- Reviewer: Andr=C3=A9s de la Pe=C3=B1a > last row of previous page =3D=3D first row of next page while querying da= ta using SASI index > -------------------------------------------------------------------------= --------------- > > Key: CASSANDRA-13302 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1330= 2 > Project: Cassandra > Issue Type: Bug > Environment: Tested with C* 3.9 and 3.10. > Reporter: Andy Tolbert > Assignee: Alex Petrov > > Apologies if this is a duplicate (couldn't track down an existing bug). > Similarly to [CASSANDRA-11208], it appears it is possible to retrieve dup= licate rows when paging using a SASI index as documented in [JAVA-1413|http= s://datastax-oss.atlassian.net/browse/JAVA-1413], the following test demons= trates that data is repeated while querying using a SASI index: > {code:java} > public class TestPagingBug > { > =09public static void main(String[] args) > =09{ > =09=09Cluster.Builder builder =3D Cluster.builder(); > =09=09Cluster c =3D builder.addContactPoints("192.168.98.190").build();= =09=09 > =09=09Session s =3D c.connect(); > =09=09 > =09=09s.execute("CREATE KEYSPACE IF NOT EXISTS test WITH replication =3D = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 }"); > =09=09s.execute("CREATE TABLE IF NOT EXISTS test.test_table_sec(sec BIGIN= T PRIMARY KEY, id INT)"); > //create secondary index on ID column, used for select st= atement > String index =3D "CREATE CUSTOM INDEX test_table_sec_idx = ON test.test_table_sec (id) USING 'org.apache.cassandra.index.sasi.SASIInde= x' " > + "WITH OPTIONS =3D { 'mode': 'PREFIX' }"; > s.execute(index); > =09=09 > =09=09PreparedStatement insert =3D s.prepare("INSERT INTO test.test_table= _sec (id, sec) VALUES (1, ?)");=09=09 > =09=09for (int i =3D 0; i < 1000; i++) > =09=09=09s.execute(insert.bind((long) i)); > =09=09 > =09=09PreparedStatement select =3D s.prepare("SELECT sec FROM test.test_t= able_sec WHERE id =3D 1"); > =09=09 > =09=09long lastSec =3D -1;=09=09 > =09=09for (Row row : s.execute(select.bind().setFetchSize(300))) > =09=09{ > =09=09=09long sec =3D row.getLong("sec"); > =09=09=09if (sec =3D=3D lastSec) > =09=09=09=09System.out.println(String.format("Duplicated id %d", sec)); > =09=09=09 > =09=09=09lastSec =3D sec; > =09=09} > =09=09System.exit(0); > =09} > } > {code} > The program outputs the following: > {noformat} > Duplicated id 23 > Duplicated id 192 > Duplicated id 684 > {noformat} > Note that the simple primary key is required to reproduce this. -- This message was sent by Atlassian JIRA (v6.3.15#6346)