cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrés de la Peña (JIRA) <>
Subject [jira] [Created] (CASSANDRA-11043) Secondary indexes doesn't properly validate custom expressions
Date Wed, 20 Jan 2016 12:24:39 GMT
Andrés de la Peña created CASSANDRA-11043:

             Summary: Secondary indexes doesn't properly validate custom expressions
                 Key: CASSANDRA-11043
             Project: Cassandra
          Issue Type: Bug
            Reporter: Andrés de la Peña

It seems that [CASSANDRA-7575|] is broken
in Cassandra 3.x. As stated in the secondary indexes' API documentation, custom index implementations
should perform any validation of query expressions at {{Index#searcherFor(ReadCommand)}},
throwing an {{InvalidRequestException}} if the expressions are not valid. I assume these validation
errors should produce an {{InvalidRequest}} error on cqlsh, or raise an {{InvalidRequestException}}
on Java driver. However, when {{Index#searcherFor(ReadCommand)}} throws its {{InvalidRequestException}},
I get this cqlsh output:
Traceback (most recent call last):
  File "bin/", line 1246, in perform_simple_statement
    result = future.result()
  File "/Users/adelapena/stratio/platform/src/cassandra-3.2.1/bin/../lib/",
line 3122, in result
    raise self._final_exception
ReadFailure: code=1300 [Replica(s) failed to execute read] message="Operation failed - received
0 responses and 1 failures" info={'failures': 1, 'received_responses': 0, 'required_responses':
1, 'consistency': 'ONE'}

I attach a dummy index implementation to reproduce the error:
CREATE KEYSPACE test with replication = {'class' : 'SimpleStrategy', 'replication_factor'
: '1' }; 
CREATE TABLE test.test (id int PRIMARY KEY, value varchar); 
CREATE CUSTOM INDEX test_index ON test.test() USING 'com.stratio.TestIndex'; 
SELECT * FROM test.test WHERE expr(test_index,'ok');
SELECT * FROM test.test WHERE expr(test_index,'error');
This is specially problematic when using Cassandra Java Driver, because one of these server
exceptions can produce subsequent queries fail (even if they are valid) with a no host available

Maybe the validation method added with [CASSANDRA-7575|]
should be restored, unless there is a way to properly manage the exception.

This message was sent by Atlassian JIRA

View raw message