# HG changeset patch # User Timo Sirainen # Date 1492768457 -10800 # Node ID 1ea4631afc59f4040b98d40b4387fc342f172d88 # Parent 486b1b94f39c76a389401b59bc11a06e4080b6be cassandra: Use fallback consistency for CASS_ERROR_LIB_NO_HOSTS_AVAILABLE errors I'm not entirely sure if this is always appropriate, but at least this error happens every time when attempting to use write_consistency=two when there is only a single Cassandra node. diff -r 486b1b94f39c -r 1ea4631afc59 src/lib-sql/driver-cassandra.c --- a/src/lib-sql/driver-cassandra.c Fri Apr 21 20:59:55 2017 +0300 +++ b/src/lib-sql/driver-cassandra.c Fri Apr 21 12:54:17 2017 +0300 @@ -841,12 +841,17 @@ enough nodes available. "All hosts in current policy attempted and were either unavailable or failed" + no hosts available = The client library couldn't connect to + enough cassanra nodes. Error message is the same as for + "unavailable". + write timeout = cassandra server couldn't reach all the needed nodes. this may be because it hasn't yet detected that the servers are down, or because the servers are just too busy. we'll try the fallback consistency to avoid unnecessary temporary errors. */ if ((error == CASS_ERROR_SERVER_UNAVAILABLE || + error == CASS_ERROR_LIB_NO_HOSTS_AVAILABLE || error == CASS_ERROR_SERVER_WRITE_TIMEOUT) && result->fallback_consistency != result->consistency) { /* retry with fallback consistency */