dovecot-2.2: cassandra: Use a local monotonic timestamp generator.
dovecot at dovecot.org
dovecot at dovecot.org
Thu Sep 24 16:42:02 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/1e4d2306f1f3
changeset: 19216:1e4d2306f1f3
user: Timo Sirainen <tss at iki.fi>
date: Thu Sep 24 19:40:41 2015 +0300
description:
cassandra: Use a local monotonic timestamp generator.
Otherwise we run into race conditions on server side timestamps, which cause
problems.
diffstat:
src/lib-sql/driver-cassandra.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diffs (29 lines):
diff -r 055d1e2d894c -r 1e4d2306f1f3 src/lib-sql/driver-cassandra.c
--- a/src/lib-sql/driver-cassandra.c Thu Sep 24 19:27:10 2015 +0300
+++ b/src/lib-sql/driver-cassandra.c Thu Sep 24 19:40:41 2015 +0300
@@ -42,6 +42,7 @@
CassCluster *cluster;
CassSession *session;
+ CassTimestampGen *timestamp_gen;
int fd_pipe[2];
struct io *io_pipe;
@@ -408,7 +409,9 @@
} T_END;
cass_log_set_level(db->log_level);
+ db->timestamp_gen = cass_timestamp_gen_server_side_new();
db->cluster = cass_cluster_new();
+ cass_cluster_set_timestamp_gen(db->cluster, db->timestamp_gen);
cass_cluster_set_connect_timeout(db->cluster, SQL_CONNECT_TIMEOUT_SECS * 1000);
cass_cluster_set_request_timeout(db->cluster, SQL_QUERY_TIMEOUT_SECS * 1000);
cass_cluster_set_contact_points(db->cluster, db->hosts);
@@ -431,6 +434,7 @@
cass_session_free(db->session);
cass_cluster_free(db->cluster);
+ cass_timestamp_gen_free(db->timestamp_gen);
i_free(db->hosts);
i_free(db->error);
i_free(db->keyspace);
More information about the dovecot-cvs
mailing list