cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-6333) ArrayIndexOutOfBound when using count(*) with over 10,000 rows
Date Fri, 15 Nov 2013 14:35:20 GMT

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

Sylvain Lebresne updated CASSANDRA-6333:
----------------------------------------

    Attachment: 6333.txt

Ok, this is due to the fact that SP.getRangeSlice might return more results than asked (due
to reconciliation, you need > 1 node) which was confusing the pager logic. Attaching patch
so that the pager trim the result in that case.

> ArrayIndexOutOfBound when using count(*) with over 10,000 rows
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-6333
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6333
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Cassandra 2.0.2, Ubuntu 12.04.3 LTS, Oracle Java 1.7.0_21
>            Reporter: Tyler Tolley
>            Assignee: Sylvain Lebresne
>             Fix For: 2.0.3
>
>         Attachments: 6333.txt
>
>
> We've been getting a TSocket read 0 bytes error when we try and run SELECT count(*) FROM
<table> if the table has over 10,000 rows.
> I've been able to reproduce the problem by using cassandra-stress to insert different
number of rows. When I insert under 10,000, the count is returned. When I insert exactly 10,000,
I get a message that my results were limited to 10,000 by default. If insert 10,001, I get
the exception below.
> {code}
> ERROR [Thrift:4] 2013-11-12 09:54:04,850 CustomTThreadPoolServer.java (line 212) Error
occurred during processing of message.
> java.lang.ArrayIndexOutOfBoundsException: -1
> 	at java.util.ArrayList.elementData(ArrayList.java:371)
> 	at java.util.ArrayList.remove(ArrayList.java:448)
> 	at org.apache.cassandra.cql3.ResultSet.trim(ResultSet.java:92)
> 	at org.apache.cassandra.cql3.statements.SelectStatement.process(SelectStatement.java:848)
> 	at org.apache.cassandra.cql3.statements.SelectStatement.pageCountQuery(SelectStatement.java:196)
> 	at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:163)
> 	at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:57)
> 	at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:129)
> 	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:145)
> 	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:136)
> 	at org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(CassandraServer.java:1936)
> 	at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4394)
> 	at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4378)
> 	at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
> 	at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
> 	at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:194)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:722)
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message