]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
cassandra: Support returning SQL_RESULT_ERROR_TYPE_WRITE_UNCERTAIN
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 15 Jul 2016 21:40:31 +0000 (16:40 -0500)
committerGitLab <gitlab@git.dovecot.net>
Sun, 17 Jul 2016 18:15:59 +0000 (21:15 +0300)
src/lib-sql/driver-cassandra.c

index 6f7fedb966600a6253d79678272b5cf723abee10..64c37bbd5ce07a6a5d2a1c921ffda19485414ac7 100644 (file)
@@ -726,6 +726,9 @@ static void query_callback(CassFuture *future, void *context)
                i_free(result->error);
 
                msecs = timeval_diff_msecs(&ioloop_timeval, &result->start_time);
+               result->api.error_type = error == CASS_ERROR_SERVER_WRITE_TIMEOUT ?
+                       SQL_RESULT_ERROR_TYPE_WRITE_UNCERTAIN :
+                       SQL_RESULT_ERROR_TYPE_UNKNOWN;
                result->error = i_strdup_printf("Query '%s' failed: %.*s (in %u.%03u secs)",
                        result->query, (int)errsize, errmsg, msecs/1000, msecs%1000);
                /* unavailable = cassandra server knows that there aren't