From: Razvan Becheriu Date: Fri, 22 Mar 2019 19:26:38 +0000 (+0200) Subject: added serial consistency to all queries X-Git-Tag: Kea-1.6.0-beta~288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2F16-cassandra-consistency-attempt2;p=thirdparty%2Fkea.git added serial consistency to all queries --- diff --git a/src/lib/cql/cql_exchange.cc b/src/lib/cql/cql_exchange.cc index f9ab63eb47..59fd38bbb4 100644 --- a/src/lib/cql/cql_exchange.cc +++ b/src/lib/cql/cql_exchange.cc @@ -912,6 +912,17 @@ CqlExchange::executeMutation(const CqlConnection& connection, const AnyArray& da " statement consistency for statement " << tagged_statement.name_ << ", Cassandra error code: " << cass_error_desc(rc)); } + if (connection.serial_consistency_ != CASS_CONSISTENCY_UNKNOWN) { + rc = cass_statement_set_serial_consistency(statement, connection.serial_consistency_); + if (rc != CASS_OK) { + cass_statement_free(statement); + isc_throw(DbOperationError, + "CqlExchange::executeMutation(): unable to set statement " + "serial consistency for statement " + << tagged_statement.name_ + << ", Cassandra error code: " << cass_error_desc(rc)); + } + } } CqlCommon::bindData(data, statement); diff --git a/src/lib/dhcpsrv/cql_lease_mgr.cc b/src/lib/dhcpsrv/cql_lease_mgr.cc index 433642dce6..46a00877d7 100644 --- a/src/lib/dhcpsrv/cql_lease_mgr.cc +++ b/src/lib/dhcpsrv/cql_lease_mgr.cc @@ -1923,6 +1923,17 @@ CqlLeaseStatsQuery::executeSelect(const CqlConnection& connection, const AnyArra << tagged_statement.name_ << ", Cassandra error code: " << cass_error_desc(rc)); } + if (connection.serial_consistency_ != CASS_CONSISTENCY_UNKNOWN) { + rc = cass_statement_set_serial_consistency(statement, connection.serial_consistency_); + if (rc != CASS_OK) { + cass_statement_free(statement); + isc_throw(DbOperationError, + "CqlExchange::executeSelect(): unable to set statement " + "serial consistency for statement " + << tagged_statement.name_ + << ", Cassandra error code: " << cass_error_desc(rc)); + } + } } CqlCommon::bindData(local_data, statement);