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

NullPointerException in cqlsh paging through CF with static columns

    XMLWordPrintableJSON

Details

    • Normal

    Description

      When running select count( * ) from cqlsh with limit, the following NPE occurs:

      select count( * ) from tbl1 limit 50000 ;

      ERROR [SharedPool-Worker-4] 2015-09-16 14:49:43,480 QueryMessage.java:132 - Unexpected error during query
      java.lang.NullPointerException: null
      at org.apache.cassandra.service.pager.RangeSliceQueryPager.containsPreviousLast(RangeSliceQueryPager.java:99) ~[cassandra-all-2.1.8.621.jar:2.1.8.621]
      at org.apache.cassandra.service.pager.AbstractQueryPager.fetchPage(AbstractQueryPager.java:119) ~[cassandra-all-2.1.8.621.jar:2.1.8.621]
      at org.apache.cassandra.service.pager.RangeSliceQueryPager.fetchPage(RangeSliceQueryPager.java:37) ~[cassandra-all-2.1.8.621.jar:2.1.8.621]
      at org.apache.cassandra.cql3.statements.SelectStatement.pageCountQuery(SelectStatement.java:286) ~[cassandra-all-2.1.8.621.jar:2.1.8.621]
      at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:230) ~[cassandra-all-2.1.8.621.jar:2.1.8.621]
      at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:67) ~[cassandra-all-2.1.8.621.jar:2.1.8.621]
      at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:238) ~[cassandra-all-2.1.8.621.jar:2.1.8.621]
      at com.datastax.bdp.cassandra.cql3.DseQueryHandler$StatementExecution.execute(DseQueryHandler.java:291) ~[dse-4.7.2.jar:4.7.2]
      at com.datastax.bdp.cassandra.cql3.DseQueryHandler$Operation.executeWithTiming(DseQueryHandler.java:223) ~[dse-4.7.2.jar:4.7.2]
      at com.datastax.bdp.cassandra.cql3.DseQueryHandler$Operation.executeWithAuditLogging(DseQueryHandler.java:259) ~[dse-4.7.2.jar:4.7.2]
      at com.datastax.bdp.cassandra.cql3.DseQueryHandler.process(DseQueryHandler.java:94) ~[dse-4.7.2.jar:4.7.2]
      at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:119) ~[cassandra-all-2.1.8.621.jar:2.1.8.621]
      at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:439) [cassandra-all-2.1.8.621.jar:2.1.8.621]
      at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:335) [cassandra-all-2.1.8.621.jar:2.1.8.621]
      at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-all-4.0.23.Final.jar:4.0.23.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-all-4.0.23.Final.jar:4.0.23.Final]
      at io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:32) [netty-all-4.0.23.Final.jar:4.0.23.Final]
      at io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:324) [netty-all-4.0.23.Final.jar:4.0.23.Final]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_75]
      at org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$FutureTask.run(AbstractTracingAwareExecutorService.java:164) [cassandra-all-2.1.8.621.jar:2.1.8.621]
      at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) [cassandra-all-2.1.8.621.jar:2.1.8.621]
      at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]
      

      Table definition looks something like:

      CREATE TABLE tbl1 (
          field1 bigint,
          field2 int,
          field3 timestamp,
          field4 map<int, float>,
          field5 text static,
          field6 text static,
          field7 text static
          PRIMARY KEY (field1, field2, field3)
      ) WITH CLUSTERING ORDER BY (field2 ASC, field3 ASC)
          AND bloom_filter_fp_chance = 0.1
          AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
          AND comment = ''
          AND compaction = {'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'}
          AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
         ...
      

      Following appears in debug log leading up to the error:

      DEBUG [SharedPool-Worker-1] 2015-09-17 15:32:06,484  AbstractQueryPager.java:95 - Fetched 101 live rows
      DEBUG [SharedPool-Worker-1] 2015-09-17 15:32:06,484  AbstractQueryPager.java:133 - Remaining rows to page: 1
      DEBUG [SharedPool-Worker-1] 2015-09-17 15:32:06,485  SelectStatement.java:285 - New maxLimit for paged count query is 1
      DEBUG [SharedPool-Worker-1] 2015-09-17 15:32:06,486  StorageProxy.java:1646 - Estimated result rows per range: 2586.375; requested rows: 2, ranges.size(): 762; concurrent range requests: 1
      DEBUG [SharedPool-Worker-1] 2015-09-17 15:32:06,487  AbstractQueryPager.java:95 - Fetched 2 live rows
      ERROR [SharedPool-Worker-1] 2015-09-17 15:32:06,487  QueryMessage.java:132 - Unexpected error during query
      java.lang.NullPointerException: null
      

      I'm working on recreating to have a workable dataset. When running cqlsh from remote node version 2.0.14, query returns successfully

      Attachments

        Issue Links

          Activity

            People

              blerer Benjamin Lerer
              Michael Keeney Michael Keeney
              Benjamin Lerer
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: