Search This Blog

Loading...

Wednesday, August 18, 2010

Lucandra Error

I've faced following error while testing my Lucandra application :

(Note: I've modified package declaration for Lucandra)

Problem:
=======

java.lang.RuntimeException: InvalidRequestException(why:start key's md5 sorts after end key's md5. this is not allowed; you probably should not specify end key at all, under RandomPartitioner)
at com.psl.lucandra.LucandraTermEnum.loadTerms(LucandraTermEnum.java:226)
at com.psl.lucandra.LucandraTermEnum.next(LucandraTermEnum.java:125)
at org.apache.lucene.search.FilteredTermEnum.next(FilteredTermEnum.java:75)
at org.apache.lucene.search.MultiTermQuery$ConstantScoreAutoRewrite.rewrite(MultiTermQuery.java:245)
at org.apache.lucene.search.MultiTermQuery.rewrite(MultiTermQuery.java:382)
at org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:307)
at org.apache.lucene.search.Query.weight(Query.java:98)
at org.apache.lucene.search.Searcher.createWeight(Searcher.java:230)
at org.apache.lucene.search.Searcher.search(Searcher.java:181)
at org.apache.lucene.search.Searcher.search(Searcher.java:191)
at com.psl.test.LucTest.search(LucTest.java:126)
at com.psl.test.LucTest.main(LucTest.java:70)
Caused by: InvalidRequestException(why:start key's md5 sorts after end key's md5. this is not allowed; you probably should not specify end key at all, under RandomPartitioner)
at org.apache.cassandra.thrift.Cassandra$get_range_slice_result.read(Cassandra.java:9769)
at org.apache.cassandra.thrift.Cassandra$Client.recv_get_range_slice(Cassandra.java:577)
at org.apache.cassandra.thrift.Cassandra$Client.get_range_slice(Cassandra.java:549)
at com.psl.lucandra.LucandraTermEnum.loadTerms(LucandraTermEnum.java:224)
... 11 more


And Here is the solution::::::(Works for me)

Step 1.   Change partitionar:
             From
              org.apache.cassandra.dht.RandomPartitioner

              To
              org.apache.cassandra.dht.OrderPreservingPartitioner

Step 2.
2.1 Stop Cassandra if running
2.2 go to cassandra system keyspcae and delete all
2.3 Start Cassandra.

Thats all .

3 comments:

  1. Hi Devesh, Thanks for this blogpost, I am also facing the same problem and this cassandra thing is totally new for me. Can you tell me how I can delete the keyspaces?

    ReplyDelete
  2. ok I found it in /var/lib/cassandra. Anyways thanks for the post. :)

    ReplyDelete
  3. SQL error: Communications link failure

    any solution for this.. have googled and tried every hot search solutions but still facing the same problem. after restarting cassandra everything works fine for 10-15mins and then it throws above mentioned error. I can see that cassandra is still running at the error stage.

    ReplyDelete