]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
added serial consistency to all queries 16-cassandra-consistency-attempt2
authorRazvan Becheriu <razvan@isc.org>
Fri, 22 Mar 2019 19:26:38 +0000 (21:26 +0200)
committerRazvan Becheriu <razvan@isc.org>
Thu, 4 Apr 2019 10:58:58 +0000 (13:58 +0300)
src/lib/cql/cql_exchange.cc
src/lib/dhcpsrv/cql_lease_mgr.cc

index f9ab63eb4789ad2ed78f52998b598385141c8285..59fd38bbb4165c5db78c92a110b1da32d0e80213 100644 (file)
@@ -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);
index 433642dce6f0eabfaa6cb830c7e83d034ff4d623..46a00877d713c3975686dafa1642ce389b6c1140 100644 (file)
@@ -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);