C# Consistency LocalQuorum > Read Time Out Error

Viewed 213

I have been seeing an obscure error message appearing on reads to my cassandra environment.

If anyone has any ideas of what I may look at to investigate this error. Not even sure why it is having a consistency all problem as when I go into a CQLSH session and set Consistency All and run a query it is happy.

Message: Cassandra timeout during read query at consistency All (2 replica(s) responded over 3 required)

Stack Trace:

at Cassandra.Tasks.TaskHelper.WaitToComplete(Task task, Int32 timeout)

at Cassandra.Session.Execute(IStatement statement)

at MyCode....:line xxx

C#:

SocketOptions options = new SocketOptions();
    options.SetConnectTimeoutMillis(30000);
    options.SetReadTimeoutMillis(5000);
    options.SetDefunctReadTimeoutThreshold(int.MaxValue);
    options.SetTcpNoDelay(true);

Cluster = Cluster.Builder()
    .AddContactPoints(seeds)
    .WithCredentials(username, password)
    .WithQueryOptions(new QueryOptions().SetConsistencyLevel(ConsistencyLevel.LocalQuorum))
    .WithPoolingOptions(new PoolingOptions().SetHeartBeatInterval(10000).SetMaxConnectionsPerHost(HostDistance.Local, 2).SetCoreConnectionsPerHost(HostDistance.Local, 2))
    .WithRetryPolicy(DowngradingConsistencyRetryPolicy.Instance)
    .WithQueryTimeout(60000)
    .WithReconnectionPolicy(new ConstantReconnectionPolicy(1000))
    .WithSpeculativeExecutionPolicy(new ConstantSpeculativeExecutionPolicy(500, 2))
    .WithLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy()))
    .WithSocketOptions(options)
    .Build();

Session = Cluster.Connect();

Calling Connection.Session.Cluster.Configuration.QueryOptions.GetConsistencyLevel() at the time a exception is raised the value is still local quorum.

Query:

3 of 3 partition keys .

1 of 2 clustering columns .

C#:

var cqlStatement = "SELECT * FROM data.poc WHERE pk1 = ? and pk2 = ? and pk3 = ? and ck1 = ?;"    
List<object> cqlParams = new List<object>();  
cqlParams.add("somestring");    
cqlParams.add(500);    
cqlParams.add(36000);    
cqlParams.add(false);    
Cassandra.PreparedStatement prepared = Session.Prepare(cqlStatement);    
Cassandra.RowSet results = 
Connection.Session.Execute(prepared.Bind(cqlParams.ToArray()));  
0 Answers
Related