Details
-
Sub-task
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Tested from build CASSANDRA-11067
Description
Tested from build CASSANDRA-11067
CREATE KEYSPACE music WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; CREATE TABLE music.albums ( id int PRIMARY KEY, title text ); cqlsh:music> CREATE CUSTOM INDEX IF NOT EXISTS ON music.albums(title) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = { 'mode':'NORMAL'}; ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException">
The error message is useless, by looking into the /var/log/cassandra/system.log message, the true error message is:
Caused by: java.lang.IllegalArgumentException: No enum constant org.apache.cassandra.index.sasi.disk.OnDiskIndexBuilder.Mode.NORMAL
at java.lang.Enum.valueOf(Enum.java:238) ~[na:1.8.0_45]
But worse, even the index creation fails, its metadata is not cleaned up so that further attempt to create an index on the same column using the correct mode also fails:
cqlsh:music> CREATE CUSTOM INDEX IF NOT EXISTS ON music.albums(title) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = { 'mode':'PREFIX'}; ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException">
The only word-around is to drop the index. The index is not displayed by DESCRIBE TABLE albums. It only appears in the system_schema.indexes table...