ConsistenceLevel ONE even setting LOCAL_ONE on client

263 views
Skip to first unread message

Luiz Carlos C. Carvalho Jr.

unread,
Feb 10, 2015, 3:06:25 PM2/10/15
to python-dr...@lists.datastax.com
Hello,

I'm having the following log in my application (timeout with CL ONE):

WriteTimeout: code=1100 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'}

But the cluster and session are created with this code:

        self.cluster = get_cluster(get_host(host), control_connection_timeout=100000, reconnection_policy=Cluster.reconnection_policy)
        self.session = self.cluster.connect(cassandra_keyspace)

        self.session.default_consistency_level = ConsistencyLevel.LOCAL_ONE
        self.session.default_timeout = 100000

I use prepared statement with TokenAware(DCAwareRoundRobin) policy. The question is: why is the query been applied with CL ONE if the client was configured with LOCAL_ONE as default consistence level ?

ps: I recently changed connection_class to LibevConnection, as asyncore reactor uses much CPU even idle (https://groups.google.com/a/lists.datastax.com/forum/#!topic/python-driver-user/-UA_oadNYk0)

Any tips ?

Thanks in advance
Luiz

Adam Holmberg

unread,
Feb 13, 2015, 2:45:54 PM2/13/15
to python-dr...@lists.datastax.com
Luiz,

I don't see anything wrong with the snippet you posted. If you can share more of your script around cluster initialization, and statement prep, I may be able to troubleshoot a little more.
 
WriteTimeout: code=1100 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'}

This would normally indicate that you contacted a node that did not have a replica, and the write timed out between this coordinator and a replica. However, if you are using TokenAware, it should be hitting a replica node directly. I don't actually see the cluster being initialized in your snippet, so I can't tell why that might not be working.

Regarding ONE vs LOCAL_ONE: The consistency level indicated in this WriteTimeout is reported back from server side. If this is reproducible, I would suggest asking on the Cassandra Users list, and/or writing up a JIRA ticket. There have been issues before with reporting consistency levels that did not reflect what was actually being used internally.

Adam Holmberg
Reply all
Reply to author
Forward
0 new messages