[ https://issues.apache.org/jira/browse/CASSANDRA-11523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sam Tunnicliffe updated CASSANDRA-11523: ---------------------------------------- Status: Patch Available (was: In Progress) The problem is that when the indexed column is not covered by the Thrift query's {{slice_predicate}} it isn't included in the data retrieved from the base table using the key obtained from the index lookup. The NPE is coming from the staleness check which expects that data to be present in the base table, it only affects thrift queries, not CQL queries against the same table. I've pushed branches off 3.0 & trunk with a simple fix to {{KeysSearcher}} which essentially mimics the pre-2.2 behaviour, which used {{ExtendedFilter}} to add any columns required for the read to the filter before pruning them from the results returned to the user. [~yngwiie], [this patch|https://github.com/beobal/cassandra/commit/517e2e78a618d0e9c6225f9b27ed837450bdcc80.patch] applies cleanly to 3.0.4. If possible, would you mind applying it and checking that it works for you? Pull request to add a new dtest for this issue is [here|https://github.com/riptano/cassandra-dtest/pull/926] ||branch||testall||dtest|| |[11523-3.0|https://github.com/beobal/cassandra/tree/11523-3.0]|[testall|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-11523-3.0-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-11523-3.0-dtest]| |[11523-trunk|https://github.com/beobal/cassandra/tree/11523-trunk]|[testall|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-11523-trunk-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-11523-trunk-dtest]| > server side exception on secondary index query through thrift > ------------------------------------------------------------- > > Key: CASSANDRA-11523 > URL: https://issues.apache.org/jira/browse/CASSANDRA-11523 > Project: Cassandra > Issue Type: Bug > Components: Core > Environment: linux opensuse 13.2, jdk8 > Reporter: Ivan Georgiev > Assignee: Sam Tunnicliffe > Fix For: 3.0.x, 3.x > > > Trying to upgrade from 2.x to 3.x, using 3.0.4 for the purpose. We are using > thrift interface for the time being. Everything works fine except for > secondary index queries. > When doing a get_range_slices call with row_filter set in the KeyRange we get > a server side exception. Here is a trace of the exception: > INFO | jvm 1 | 2016/04/07 14:56:35 | 14:56:35.401 [Thrift:12] DEBUG > o.a.cassandra.service.ReadCallback - Failed; received 0 of 1 responses > INFO | jvm 1 | 2016/04/07 14:56:35 | 14:56:35.401 [SharedPool-Worker-1] > WARN o.a.c.c.AbstractLocalAwareExecutorService - Uncaught exception on > thread Thread[SharedPool-Worker-1,5,main]: {} > INFO | jvm 1 | 2016/04/07 14:56:35 | java.lang.RuntimeException: > java.lang.NullPointerException > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2450) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > ~[na:1.8.0_72] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) > [apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > java.lang.Thread.run(Thread.java:745) [na:1.8.0_72] > INFO | jvm 1 | 2016/04/07 14:56:35 | Caused by: > java.lang.NullPointerException: null > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.index.internal.keys.KeysSearcher.filterIfStale(KeysSearcher.java:155) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.index.internal.keys.KeysSearcher.access$300(KeysSearcher.java:36) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.index.internal.keys.KeysSearcher$1.prepareNext(KeysSearcher.java:104) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.index.internal.keys.KeysSearcher$1.hasNext(KeysSearcher.java:70) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:72) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:295) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.ReadResponse$LocalDataResponse.<init>(ReadResponse.java:127) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.ReadResponse$LocalDataResponse.<init>(ReadResponse.java:123) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.ReadResponse.createDataResponse(ReadResponse.java:65) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.ReadCommand.createResponse(ReadCommand.java:289) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(StorageProxy.java:1792) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2446) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | ... 4 common frames omitted > INFO | jvm 1 | 2016/04/07 14:56:35 | 14:56:35.403 [Thrift:16] DEBUG > o.a.cassandra.service.ReadCallback - Failed; received 0 of 1 responses > INFO | jvm 1 | 2016/04/07 14:56:35 | 14:56:35.404 [SharedPool-Worker-1] > WARN o.a.c.c.AbstractLocalAwareExecutorService - Uncaught exception on > thread Thread[SharedPool-Worker-1,5,main]: {} > INFO | jvm 1 | 2016/04/07 14:56:35 | java.lang.RuntimeException: > java.lang.NullPointerException > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2450) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > ~[na:1.8.0_72] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) > [apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > java.lang.Thread.run(Thread.java:745) [na:1.8.0_72] > INFO | jvm 1 | 2016/04/07 14:56:35 | Caused by: > java.lang.NullPointerException: null > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.index.internal.keys.KeysSearcher.filterIfStale(KeysSearcher.java:155) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.index.internal.keys.KeysSearcher.access$300(KeysSearcher.java:36) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.index.internal.keys.KeysSearcher$1.prepareNext(KeysSearcher.java:104) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.index.internal.keys.KeysSearcher$1.hasNext(KeysSearcher.java:70) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:72) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:295) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.ReadResponse$LocalDataResponse.<init>(ReadResponse.java:127) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.ReadResponse$LocalDataResponse.<init>(ReadResponse.java:123) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.ReadResponse.createDataResponse(ReadResponse.java:65) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.db.ReadCommand.createResponse(ReadCommand.java:289) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(StorageProxy.java:1792) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | at > org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2446) > ~[apache-cassandra-3.0.4.jar:3.0.4] > INFO | jvm 1 | 2016/04/07 14:56:35 | ... 4 common frames omitted > The row_filter has 2 EQ IndexExpressions in it, nothing fancy. Let me know if > more information is needed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)