seou1
seou1

Reputation: 496

Cassandra with c#

I am getting following error while querying the cassandra column family using asp.net csharp. My cassandra version is 1.2.1

An unhandled exception of type 'Cassandra.ProtocolErrorException' occurred in Cassandra.dll

Additional information: Unknown code 10 for a consistency level

Please suggest the resolution.

Upvotes: 3

Views: 1308

Answers (2)

Andy Tolbert
Andy Tolbert

Reputation: 11638

The issue is probably that the C# driver by default is using LOCAL_ONE consistency level and as Teddy Ma suggests, 1.2.1 is an old release that doesn't support it.

Cassandra 1.2.12 is the first version of C* that supports LOCAL_ONE (0x10 CL).

More discussion recently here on the python list: https://groups.google.com/a/lists.datastax.com/forum/#!topic/python-driver-user/iBT4W-Ne2y4

I was curious about this as I had thought C* 1.2 supports LOCAL_ONE. I turns out LOCAL_ONE was not added until Cassandra 1.2.11, and it was added with the wrong code (0x8 instead of 0x10). This was fixed by CASSANDRA-6347 in 1.2.12.

You can get around this by setting the Consistency Level explicitly on QueryOptions, or by upgrading to a newer version of cassandra (if you have to stay on 1.2, use 1.2.19).

Upvotes: 1

Teddy Ma
Teddy Ma

Reputation: 1136

I think you need to explicitly specify the protocol version to 1 when creating the cluster instance. v3 of C# driver are quite new while v1.2.1 of cassandra server is very old. Please check this official doc for details: http://docs.datastax.com/en/developer/csharp-driver/3.0/common/drivers/introduction/driverDependencies_r.html?scroll=reference_ds_a1z_m5f_5j__build-environment-dependencies-section

Upvotes: 2

Related Questions