cassandra-lucene-index icon indicating copy to clipboard operation
cassandra-lucene-index copied to clipboard

Lucene index creation fails in unit test cases for cassandra 2.2.6

Open shasidhareranti opened this issue 8 years ago • 6 comments

 [testng] 22:07:50.731 [SharedPool-Worker-2] DEBUG c.s.c.lucene.service.LuceneIndex - actional_dashboard.reportconfig.lucene update document Document docValuesType=SORTED_SET indexed,tokenized,omitNorms,indexOptions=DOCS docValuesType=SORTED_SET indexed,tokenized,omitNorms,indexOptions=DOCS docValuesType=SORTED_SET indexed,tokenized,omitNorms,indexOptions=DOCS docValuesType=SORTED_SET indexed,tokenized,omitNorms,indexOptions=DOCS,numericType=LONG,numericPrecisionStep=16,docValuesType=NUMERIC<3173195065897216566><_partition_key: b8 c8 e0 e7 b4 ce><_primary_key: b8 c8 e0 e7 b4 ce>

shasidhareranti avatar Nov 16 '16 17:11 shasidhareranti

@adelapena Is this normal behaviour while updating indexes in unit test cases?

shasidhareranti avatar Nov 17 '16 06:11 shasidhareranti

Hi @shasidhareranti

If you run mvn clean test Does the unit test complete successfully?

It should show something similar to this:

Results :

Tests run: 1283, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Cassandra Lucene index ............................ SUCCESS [0.532s]
[INFO] Cassandra Lucene Index builder .................... SUCCESS [2.593s]
[INFO] Cassandra Lucene Index plugin ..................... SUCCESS [17.052s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.417s
[INFO] Finished at: Mon Nov 21 10:36:16 CET 2016
[INFO] Final Memory: 51M/510M
[INFO] ------------------------------------------------------------------------

You are using version 2.2.6.2, aren't you?

ealonsodb avatar Nov 21 '16 09:11 ealonsodb

Hi What i mean is, when i try to create index in our application unit tests the index updation fails. In our application we start cassandra server, create tables with required UDTs , indexes and try to add some data.

By adding new rows index updation is triggered in background, which is failing with the error that i have posted above.

shasidhareranti avatar Nov 21 '16 09:11 shasidhareranti

Hi @shasidhareranti : Can you please show us the exact unit test in CQL?

ealonsodb avatar Nov 21 '16 10:11 ealonsodb

The problem seems to point to a wrong/incompatible implementation of a Lucene analyzer being called during the tests.

  • Which version of the Lucene index plugin are you using?
  • How are you running Cassandra during the tests? Maybe as an embedded service? If so, could you have any conflicting dependency?
  • Could you provide any information about the failing test? Which analyzers are involved?

adelapena avatar Nov 21 '16 10:11 adelapena

We are using cassandra-lucene-index-plugin-2.2.6.2.jar. Yes as part of unit tests we are running embedded cassandra server. There are no other conflicting dependency as you can observe in the stack trace as below.

   [testng] java.lang.AssertionError: TokenStream implementation classes or at least their incrementToken() implementation must be final
   [testng] 	at org.apache.lucene.analysis.TokenStream.assertFinal(TokenStream.java:126) ~[cassandra-lucene-index-plugin-2.2.6.2.jar:na]

We are using the following index in our tables

{"default_analyzer":"english","fields":{"type":{"type":"string","case_sensitive":false},"title":{"type":"string","case_sensitive":false},"labels":{"type":"string","case_sensitive":false}}}

shasidhareranti avatar Nov 21 '16 11:11 shasidhareranti