]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
cassandra: Use fallback consistency for CASS_ERROR_LIB_NO_HOSTS_AVAILABLE errors
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 21 Apr 2017 09:54:17 +0000 (12:54 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 24 Apr 2017 08:34:54 +0000 (11:34 +0300)
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.

src/lib-sql/driver-cassandra.c

index 7ea57aa5f1a01f5c3457bdbbac07d65fccc68b29..7608fb566311594422fc4dc75c73d2ad5804aa76 100644 (file)
@@ -841,12 +841,17 @@ static void query_callback(CassFuture *future, void *context)
                   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 */