Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-6333

ArrayIndexOutOfBound when using count(*) with over 10,000 rows

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.0.3
    • None
    • None
    • Cassandra 2.0.2, Ubuntu 12.04.3 LTS, Oracle Java 1.7.0_21

    • Normal

    Description

      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.

      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)
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            slebresne Sylvain Lebresne Assign to me
            thattolleyguy Tyler Tolley
            Sylvain Lebresne
            Aleksey Yeschenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment