cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Lerer (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CASSANDRA-10442) Paging repeats records
Date Mon, 12 Oct 2015 12:02:05 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-10442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Benjamin Lerer resolved CASSANDRA-10442.
----------------------------------------
    Resolution: Won't Fix

> Paging repeats records
> ----------------------
>
>                 Key: CASSANDRA-10442
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10442
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Robert Wille
>            Assignee: Benjamin Lerer
>
> Paging repeats records every fetchSize records. The following sample easily reproduces
the problem on Cassandra 2.0.16 with Java Driver 2.0.11.
> {noformat}
> public class TestPagingBug
> {
> 	public static void main(String[] args)
> 	{
> 		Cluster.Builder builder = Cluster.builder();
> 		Cluster c = builder.addContactPoints("192.168.98.190").build();		
> 		Session s = c.connect();
> 		
> 		s.execute("CREATE KEYSPACE IF NOT EXISTS test WITH replication = { 'class' : 'SimpleStrategy',
'replication_factor' : 3 }");
> 		s.execute("CREATE TABLE IF NOT EXISTS test.test_page(id INT, sec BIGINT, data VARCHAR
static, PRIMARY KEY ((id), sec))");
> 		s.execute("INSERT INTO test.test_page (id, data) VALUES (1, 'asdfasdfasdfasdfasdfasdf')");
> 		
> 		PreparedStatement insert = s.prepare("INSERT INTO test.test_page (id, sec) VALUES (1,
?)");		
> 		for (int i = 0; i < 1000; i++)
> 			s.execute(insert.bind((long) i));
> 		
> 		PreparedStatement select = s.prepare("SELECT sec FROM test.test_page WHERE id = 1");
> 		
> 		long lastSec = -1;		
> 		for (Row row : s.execute(select.bind().setFetchSize(300)))
> 		{
> 			long sec = row.getLong("sec");
> 			if (sec == lastSec)
> 				System.out.println(String.format("Duplicated id %d", sec));
> 			
> 			lastSec = sec;
> 		}
> 		System.exit(0);
> 	}
> }
> {noformat}
> The program outputs the following:
> Duplicated id 299
> Duplicated id 598
> Duplicated id 897
> Note that the static column is required. This bug doesn't occur if you remove the column
from the schema.
> I realize that this may be a driver bug, but I don't really know, so I'm logging it here
until that can be determined.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message