Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .build.osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ configure_environment() {
install_libuv() {
if brew ls --versions libuv > /dev/null; then
if ! brew outdated libuv; then
brew upgrade --cleanup libuv
brew upgrade libuv
fi
else
brew install libuv
Expand All @@ -32,7 +32,7 @@ install_libuv() {
install_openssl() {
if brew ls --versions openssl > /dev/null; then
if ! brew outdated openssl; then
brew upgrade --cleanup openssl
brew upgrade openssl
fi
else
brew install openssl
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2.12.0
===========

Features
--------
[CPP-751] Call host listener callback for the initial set of hosts

Bug Fixes
--------
[CPP-755] UDT metadata not being properly populated/updated

Other
--------
[CPP-705] Deprecate DC-aware multi-DC settings (`used_hosts_per_remote_dc`
and `allowRemoteDCsForLocalConsistencyLevel `)
[CPP-720] Streamline custom allocator

2.11.0
===========

Expand Down
8 changes: 4 additions & 4 deletions appveyor.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ add_dependencies(`${PROJECT_NAME} `${LIBUV_LIBRARY_NAME})
$cmakelists_contents | Out-File -FilePath "CMakeLists.txt" -Encoding Utf8 -Force

Write-Host "Configuring libuv"
cmake -G "$($cmake_generator)" -DBUILD_SHARED_LIBS=On "-DLIBUV_VERSION=$($Env:LIBUV_VERSION)" "-DLIBUV_INSTALL_PREFIX=$($Env:LIBUV_ROOT_DIR)"
cmake -G "$($cmake_generator)" -DBUILD_SHARED_LIBS=On "-DLIBUV_VERSION=$($Env:LIBUV_VERSION)" "-DLIBUV_INSTALL_PREFIX=$($Env:LIBUV_ROOT_DIR)" .
If ($LastExitCode -ne 0) {
If (Test-Path -Path "build/CMakeFiles/CMakeOutput.log") {
Push-AppveyorArtifact "build/CMakeFiles/CMakeOutput.log" -DeploymentName "libuv Output Log"
Expand Down Expand Up @@ -395,7 +395,7 @@ add_dependencies(`${PROJECT_NAME} `${OPENSSL_LIBRARY_NAME})
if ("$_" -Like "shared") {
$shared_libs = "On"
}
cmake -G "$($cmake_generator)" "-DBUILD_SHARED_LIBS=$($shared_libs)" "-DOPENSSL_VERSION=$($Env:OPENSSL_VERSION)" "-DOPENSSL_INSTALL_PREFIX=$($Env:OPENSSL_BASE_DIR)/$_"
cmake -G "$($cmake_generator)" "-DBUILD_SHARED_LIBS=$($shared_libs)" "-DOPENSSL_VERSION=$($Env:OPENSSL_VERSION)" "-DOPENSSL_INSTALL_PREFIX=$($Env:OPENSSL_BASE_DIR)/$_" .
If ($LastExitCode -ne 0) {
If (Test-Path -Path "build/CMakeFiles/CMakeOutput.log") {
Push-AppveyorArtifact "build/CMakeFiles/CMakeOutput.log" -DeploymentName "OpenSSL Output Log"
Expand Down Expand Up @@ -476,7 +476,7 @@ add_dependencies(`${PROJECT_NAME} `${BOOST_LIBRARY_NAME})
$cmakelists_contents | Out-File -FilePath "CMakeLists.txt" -Encoding Utf8 -Force

Write-Host "Configuring Boost"
cmake -G "$($cmake_generator)" "-DBOOST_VERSION=$($Env:BOOST_VERSION)" "-DBOOST_INSTALL_PREFIX=$($Env:BOOST_ROOT)"
cmake -G "$($cmake_generator)" "-DBOOST_VERSION=$($Env:BOOST_VERSION)" "-DBOOST_INSTALL_PREFIX=$($Env:BOOST_ROOT)" .
If ($LastExitCode -ne 0) {
If (Test-Path -Path "build/CMakeFiles/CMakeOutput.log") {
Push-AppveyorArtifact "build/CMakeFiles/CMakeOutput.log" -DeploymentName "Boost Output Log"
Expand Down Expand Up @@ -524,7 +524,7 @@ add_dependencies(`${PROJECT_NAME} `${LIBSSH2_LIBRARY_NAME})
$cmakelists_contents | Out-File -FilePath "CMakeLists.txt" -Encoding Utf8 -Force

Write-Host "Configuring libssh2"
cmake -G "$($cmake_generator)" "-DLIBSSH2_VERSION=$($Env:LIBSSH2_VERSION)" "-DLIBSSH2_INSTALL_PREFIX=$($Env:LIBSSH2_ROOT_DIR)"
cmake -G "$($cmake_generator)" "-DLIBSSH2_VERSION=$($Env:LIBSSH2_VERSION)" "-DLIBSSH2_INSTALL_PREFIX=$($Env:LIBSSH2_ROOT_DIR)" .
If ($LastExitCode -ne 0) {
If (Test-Path -Path "build/CMakeFiles/CMakeOutput.log") {
Push-AppveyorArtifact "build/CMakeFiles/CMakeOutput.log" -DeploymentName "libssh2 Output Log"
Expand Down
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ environment:
APPVEYOR_BUILD_WORKER_CLOUD: gce
APPVEYOR_IGNORE_COMMIT_FILTERING_ON_TAG: true
DRIVER_TYPE: CASS
BOOST_VERSION: 1.68.0
LIBSSH2_VERSION: 1.8.0
LIBUV_VERSION: 1.24.0
OPENSSL_1_0_VERSION: 1.0.2q
OPENSSL_1_1_VERSION: 1.1.1a
BOOST_VERSION: 1.69.0
LIBSSH2_VERSION: 1.8.2
LIBUV_VERSION: 1.28.0
OPENSSL_1_0_VERSION: 1.0.2r
OPENSSL_1_1_VERSION: 1.1.1b
matrix:
- CMAKE_GENERATOR: Visual Studio 10 2010
OPENSSL_MAJOR_MINOR: 1.0
Expand Down
8 changes: 4 additions & 4 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ architecture:
os:
- ubuntu/bionic64/cpp
- ubuntu/trusty64/cpp
- ubuntu/xenial64
- centos/6-64
- centos/7-64
- ubuntu/xenial64/cpp
- centos/6-64/cpp
- centos/7-64/cpp
- osx/high-sierra
env:
LIBUV_VERSION: 1.24.0
LIBUV_VERSION: 1.28.0
build:
- script: |
. .build.sh
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/ExternalProject-Boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if(NOT BOOST_INSTALL_PREFIX)
endif()
option(BOOST_VERSION "Boost version to build and install")
if(NOT BOOST_VERSION)
set(BOOST_VERSION "1.68.0")
set(BOOST_VERSION "1.69.0")
endif()
set(BOOST_VERSION ${BOOST_VERSION} CACHE STRING "Boost version to build and install" FORCE)

Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/ExternalProject-OpenSSL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ endif()
# OpenSSL related CMake options
option(OPENSSL_VERSION "OpenSSL version to build and install")
if(NOT OPENSSL_VERSION)
# TODO: Should we default to OpenSSL 1.1 (e.g. 1.1.1a)?
set(OPENSSL_VERSION "1.0.2q")
# TODO: Should we default to OpenSSL 1.1 (e.g. 1.1.1b)?
set(OPENSSL_VERSION "1.0.2r")
endif()
option(OPENSSL_INSTALL_PREFIX "OpenSSL installation prefix location")
if(CASS_USE_ZLIB)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/ExternalProject-libssh2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(NOT LIBSSH2_INSTALL_PREFIX)
endif()
option(LIBSSH2_VERSION "libssh2 version to build and install")
if(NOT LIBSSH2_VERSION)
set(LIBSSH2_VERSION "1.8.0")
set(LIBSSH2_VERSION "1.8.2")
endif()
set(LIBSSH2_VERSION ${LIBSSH2_VERSION} CACHE STRING "libssh2 version to build and install" FORCE)

Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/ExternalProject-libuv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(NOT LIBUV_INSTALL_PREFIX)
endif()
option(LIBUV_VERSION "libuv version to build and install")
if(NOT LIBUV_VERSION)
set(LIBUV_VERSION "1.24.0")
set(LIBUV_VERSION "1.28.0")
endif()
set(LIBUV_VERSION ${LIBUV_VERSION} CACHE STRING "libuv version to build and install" FORCE)

Expand Down
2 changes: 2 additions & 0 deletions docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ rules:
use_path_nav_files_only: true

versions:
- name: "2.12"
ref: 2.12.0
- name: "2.11"
ref: 2.11.0
- name: "2.10"
Expand Down
8 changes: 4 additions & 4 deletions examples/host_listener/host_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ void on_host_listener(CassHostListenerEvent event, CassInet inet, void* data) {
cass_inet_string(inet, address);
if (event == CASS_HOST_LISTENER_EVENT_ADD) {
printf("Host %s has been ADDED\n", address);
} else if (event == CASS_HOST_LISTENER_EVENT_REMOVE) {
} else if (event == CASS_HOST_LISTENER_EVENT_REMOVE) {
printf("Host %s has been REMOVED\n", address);
} else if (event == CASS_HOST_LISTENER_EVENT_UP) {
} else if (event == CASS_HOST_LISTENER_EVENT_UP) {
printf("Host %s is UP\n", address);
} else if (event == CASS_HOST_LISTENER_EVENT_DOWN) {
} else if (event == CASS_HOST_LISTENER_EVENT_DOWN) {
printf("Host %s is DOWN\n", address);
}
}
}

int main(int argc, char* argv[]) {
Expand Down
36 changes: 30 additions & 6 deletions gtests/src/integration/integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "integration.hpp"
#include "options.hpp"

#include <algorithm>
#include <cstdarg>
#include <iostream>
#include <sys/stat.h>
Expand Down Expand Up @@ -60,7 +61,12 @@ Integration::Integration()
, create_keyspace_query_("")
, start_time_(0ull) {
// Determine if the schema keyspaces table should be updated
if (server_version_ >= "3.0.0") {
// TODO: Make cass_version (and dse_version) available for all tests
CCM::CassVersion cass_version = server_version_;
if (Options::is_dse()) {
cass_version = static_cast<CCM::DseVersion>(cass_version).get_cass_version();
}
if (cass_version >= "3.0.0") {
system_schema_keyspaces_ = "system_schema.keyspaces";
}

Expand Down Expand Up @@ -391,13 +397,31 @@ bool Integration::force_decommission_node(unsigned int node) {
return decommission_node(node, true);
}

bool Integration::stop_node(unsigned int node) {
bool Integration::start_node(unsigned int node) {
// Stop the requested node
bool status = ccm_->stop_node(node);
if (status) {
stopped_nodes_.push_back(node);
if (ccm_->is_node_down(node, true)) {
bool status = ccm_->start_node(node);
std::vector<unsigned int>::iterator it = std::find(stopped_nodes_.begin(),
stopped_nodes_.end(),
node);
if (it != stopped_nodes_.end()) {
stopped_nodes_.erase(it);
}
return status;
}
return status;
return false;
}

bool Integration::stop_node(unsigned int node, bool is_kill /*= false*/) {
// Stop the requested node
if (ccm_->is_node_up(node, true)) {
bool status = ccm_->stop_node(node, is_kill);
if (status) {
stopped_nodes_.push_back(node);
}
return status;
}
return false;
}

std::string Integration::generate_contact_points(const std::string& ip_prefix,
Expand Down
22 changes: 19 additions & 3 deletions gtests/src/integration/integration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@
}

#define CHECK_VALUE_TYPE_VERSION(type) \
if (this->server_version_ < type::supported_server_version()) { \
SKIP_TEST_VERSION(this->server_version_.to_string(), \
CCM::CassVersion cass_version = this->server_version_; \
if (Options::is_dse()) { \
cass_version = static_cast<CCM::DseVersion>(cass_version).get_cass_version(); \
} \
if (cass_version < type::supported_server_version()) { \
SKIP_TEST_VERSION(cass_version.to_string(), \
type::supported_server_version()) \
}

Expand Down Expand Up @@ -423,14 +427,26 @@ class Integration : public testing::Test {
*/
virtual bool force_decommission_node(unsigned int node);

/**
* Start a node that was previously stopped to ensure that it is not restarted
* after test is completed
*
* @param node Node that should be started
* @return True if node was started; false otherwise (the node is invalid or
* was already started)
*/
virtual bool start_node(unsigned int node);

/**
* Stop a node that should be restarted after test is completed
*
* @param node Node that should be stopped
* @param is_kill True if forced termination requested; false otherwise
* (default: false)
* @return True if node was stopped; false otherwise (the node is invalid or
* was already stopped)
*/
virtual bool stop_node(unsigned int node);
virtual bool stop_node(unsigned int node, bool is_kill = false);

/**
* Generate the contact points for the cluster
Expand Down
3 changes: 2 additions & 1 deletion gtests/src/integration/objects/user_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ class UserType : public Object<CassUserType, cass_user_type_free> {
}

// Create the user type from the data type
Object::set(cass_user_type_new_from_data_type(data_type));
Object<CassUserType, cass_user_type_free>::set(
cass_user_type_new_from_data_type(data_type));
}
};

Expand Down
2 changes: 1 addition & 1 deletion gtests/src/integration/policies/ignore_retry_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class IgnoreRetryPolicy : public cass::DefaultRetryPolicy {
* @return Driver ready retry policy
*/
static ::test::driver::RetryPolicy policy() {
cass::RetryPolicy* policy = cass::Memory::allocate<IgnoreRetryPolicy>();
cass::RetryPolicy* policy = new IgnoreRetryPolicy();
policy->inc_ref();
return CassRetryPolicy::to(policy);
}
Expand Down
2 changes: 1 addition & 1 deletion gtests/src/integration/policies/next_host_retry_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class NextHostRetryPolicy : public cass::DefaultRetryPolicy {
* @return Driver ready retry policy
*/
static ::test::driver::RetryPolicy policy() {
cass::RetryPolicy* policy = cass::Memory::allocate<NextHostRetryPolicy>();
cass::RetryPolicy* policy = new NextHostRetryPolicy();
policy->inc_ref();
return CassRetryPolicy::to(policy);
}
Expand Down
2 changes: 1 addition & 1 deletion gtests/src/integration/shared_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class SharedPtr {
SharedPtr(T* ptr = NULL)
: object_(NULL) {
if (ptr) {
ObjectRef<T, D>* object_ref = cass::Memory::allocate<ObjectRef<T, D> >(ptr);
ObjectRef<T, D>* object_ref = new ObjectRef<T, D>(ptr);
object_ = cass::SharedRefPtr<ObjectRef<T, D> >(object_ref);
}
}
Expand Down
2 changes: 1 addition & 1 deletion gtests/src/integration/simulacron/priming_requests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Request {
};

Request()
: then_(cass::Memory::allocate<Success>()) { };
: then_(new Success()) { };

/**
* Generate the JSON for the priming request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SimulacronIntegration::~SimulacronIntegration() {

void SimulacronIntegration::SetUpTestCase() {
try {
sc_ = cass::Memory::allocate<test::SimulacronCluster>();
sc_ = new test::SimulacronCluster();
} catch (SimulacronCluster::Exception scce) {
TEST_LOG_ERROR(scce.what());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ SIMULACRON_INTEGRATION_TEST_F(IdempotentTest, WriteTimeoutNonIdempotentNoRetry)
SKIP_TEST_IF_SIMULACRON_UNAVAILABLE;

// Simulate a write timeout on node 1
prime_mock_query_with_result(cass::Memory::allocate<prime::WriteTimeout>(), 1);
prime_mock_query_with_result(new prime::WriteTimeout(), 1);

// Loop through all the nodes in the cluster execute the mock query
for (unsigned int n = 0; n < number_dc1_nodes_; ++n) {
Expand Down Expand Up @@ -108,7 +108,7 @@ SIMULACRON_INTEGRATION_TEST_F(IdempotentTest, WriteTimeoutIdempotentRetry) {
SKIP_TEST_IF_SIMULACRON_UNAVAILABLE;

// Simulate a write timeout on node 1
prime_mock_query_with_result(cass::Memory::allocate<prime::WriteTimeout>(), 1);
prime_mock_query_with_result(new prime::WriteTimeout(), 1);

// Loop through all the nodes in the cluster execute the mock query
bool was_node_one_attempted = false;
Expand Down Expand Up @@ -141,7 +141,7 @@ SIMULACRON_INTEGRATION_TEST_F(IdempotentTest, ClosedConnectionNonIdempotentNoRet
SKIP_TEST_IF_SIMULACRON_UNAVAILABLE;

// Simulate a closed connection on node 1
prime_mock_query_with_result(cass::Memory::allocate<prime::CloseConnection>(), 1);
prime_mock_query_with_result(new prime::CloseConnection(), 1);

// Loop through all the nodes in the cluster execute the mock query
for (unsigned int n = 0; n < number_dc1_nodes_; ++n) {
Expand Down Expand Up @@ -171,7 +171,7 @@ SIMULACRON_INTEGRATION_TEST_F(IdempotentTest, ClosedConnectionIdempotentRetry) {
SKIP_TEST_IF_SIMULACRON_UNAVAILABLE;

// Simulate a closed connection on node 1
prime_mock_query_with_result(cass::Memory::allocate<prime::CloseConnection>(), 1);
prime_mock_query_with_result(new prime::CloseConnection(), 1);

// Loop through all the nodes in the cluster execute the mock query
bool was_node_one_attempted = false;
Expand Down
12 changes: 10 additions & 2 deletions gtests/src/integration/tests/test_auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,11 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, BadCredentials) {
CHECK_FAILURE;

// Add the proper logging criteria (based on server version)
if (server_version_ >= "3.10") {
CCM::CassVersion cass_version = this->server_version_;
if (Options::is_dse()) {
cass_version = static_cast<CCM::DseVersion>(cass_version).get_cass_version();
}
if (cass_version >= "3.10") {
logger_.add_critera("Provided username invalid and/or password are incorrect");
} else {
logger_.add_critera("Username and/or password are incorrect");
Expand Down Expand Up @@ -241,7 +245,11 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, AuthenticatorSetErrorNull) {
CHECK_FAILURE;

// Add the proper logging criteria (based on server version)
if (server_version_ >= "3.10") {
CCM::CassVersion cass_version = this->server_version_;
if (Options::is_dse()) {
cass_version = static_cast<CCM::DseVersion>(cass_version).get_cass_version();
}
if (cass_version >= "3.10") {
logger_.add_critera("Provided username invalid and/or password are incorrect");
} else {
logger_.add_critera("Username and/or password are incorrect");
Expand Down
Loading