I've got trouble setting CONSISTENCY level via C++ driver (GitHub clone).
I'm using Cassandra 2.1.8.
I've tried to set CONSISTENCY via a separate statement "CONSISTENCY ALL;",
that gives me CassError of 0x02002000 (a syntax error).
I've also tried to set consistency per statement (a SELECT); sending such a statement
results in CassError of 0x0100000a (a protocol error).
In the driver log, I can only see TRACE-level messages announcing consumption
of CQL_OPCODE_ERROR type messages from the server.
Upon connection establishing, a WARN message informs me that protocol v3 is used.
I seem to be at my wits' end, here; thanks for any suggestions.
Regards,
vencik
> I've tried to set CONSISTENCY via a separate statement "CONSISTENCY ALL;",
> that gives me CassError of 0x02002000 (a syntax error).
It looks like you are trying to use CQLSH commands (http://docs.datastax.com/en/cql/3.1/cql/cql_reference/consistency_r.html) through the C/C++ driver. What you will need to do instead is set the consistency level on the CassStatement object.
> I've also tried to set consistency per statement (a SELECT); sending such a statement
> results in CassError of 0x0100000a (a protocol error).
In this scenario I am going to assume that you are trying to set the consistency level via the SELECT statement in the USING clause (e.g. USING CONSISTENCY ALL). If that is the case then this is CQL2 syntax and is not valid in CQL3; consistency levels starting in CQL3 are set at the protocol level.
For both of the above issues you will want to create a CassStatement object and set the consistency level on the statement before it is executed on the server; http://datastax.github.io/cpp-driver/topics/basics/consistency.
> In the driver log, I can only see TRACE-level messages announcing consumption
> of CQL_OPCODE_ERROR type messages from the server.
> Upon connection establishing, a WARN message informs me that protocol v3 is used.
I am going to assume that you are using the current HEAD or 2.2.0-beta1 release of the driver. If this is the case, then the message is completely harmless since the highest protocol level for Cassandra v2.1.8 is v3 and HEAD/2.2.0-beta1 defaults to protocol v4; the driver automatically downgrades to the highest supported protocol available by the Cassandra server.
Good luck!
~Fero
I'm on https://github.com/datastax/cpp-driver master HEAD.
To unsubscribe from this group and stop receiving emails from it, send an email to cpp-driver-us...@lists.datastax.com.
got the following reason from the future:
"All hosts in current policy attempted and were either unavailable or failed".
Still, it only happens with ALL consistency; if I call the function above with CASS_CONSISTENCY_ONE, the statement execution is successful.
Note that I run it on a single-node cluster...
Thanks for help,
vencik
Thanks for help, everybody.
Best regards
vencik