Skip to content

Commit bce5273

Browse files
author
Michael Fero
committed
Merge remote-tracking branch 'dse/master' into 2.12.0_prep
2 parents 4a4b3a6 + 78d9e0c commit bce5273

File tree

201 files changed

+2795
-1890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+2795
-1890
lines changed

.build.osx.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ configure_environment() {
2222
install_libuv() {
2323
if brew ls --versions libuv > /dev/null; then
2424
if ! brew outdated libuv; then
25-
brew upgrade --cleanup libuv
25+
brew upgrade libuv
2626
fi
2727
else
2828
brew install libuv
@@ -32,7 +32,7 @@ install_libuv() {
3232
install_openssl() {
3333
if brew ls --versions openssl > /dev/null; then
3434
if ! brew outdated openssl; then
35-
brew upgrade --cleanup openssl
35+
brew upgrade openssl
3636
fi
3737
else
3838
brew install openssl

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
2.12.0
2+
===========
3+
4+
Features
5+
--------
6+
[CPP-751] Call host listener callback for the initial set of hosts
7+
8+
Bug Fixes
9+
--------
10+
[CPP-755] UDT metadata not being properly populated/updated
11+
12+
Other
13+
--------
14+
[CPP-705] Deprecate DC-aware multi-DC settings (`used_hosts_per_remote_dc`
15+
and `allowRemoteDCsForLocalConsistencyLevel `)
16+
[CPP-720] Streamline custom allocator
17+
118
2.11.0
219
===========
320

appveyor.ps1

+4-4
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ add_dependencies(`${PROJECT_NAME} `${LIBUV_LIBRARY_NAME})
342342
$cmakelists_contents | Out-File -FilePath "CMakeLists.txt" -Encoding Utf8 -Force
343343

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

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

526526
Write-Host "Configuring libssh2"
527-
cmake -G "$($cmake_generator)" "-DLIBSSH2_VERSION=$($Env:LIBSSH2_VERSION)" "-DLIBSSH2_INSTALL_PREFIX=$($Env:LIBSSH2_ROOT_DIR)"
527+
cmake -G "$($cmake_generator)" "-DLIBSSH2_VERSION=$($Env:LIBSSH2_VERSION)" "-DLIBSSH2_INSTALL_PREFIX=$($Env:LIBSSH2_ROOT_DIR)" .
528528
If ($LastExitCode -ne 0) {
529529
If (Test-Path -Path "build/CMakeFiles/CMakeOutput.log") {
530530
Push-AppveyorArtifact "build/CMakeFiles/CMakeOutput.log" -DeploymentName "libssh2 Output Log"

appveyor.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ environment:
3939
APPVEYOR_BUILD_WORKER_CLOUD: gce
4040
APPVEYOR_IGNORE_COMMIT_FILTERING_ON_TAG: true
4141
DRIVER_TYPE: CASS
42-
BOOST_VERSION: 1.68.0
43-
LIBSSH2_VERSION: 1.8.0
44-
LIBUV_VERSION: 1.24.0
45-
OPENSSL_1_0_VERSION: 1.0.2q
46-
OPENSSL_1_1_VERSION: 1.1.1a
42+
BOOST_VERSION: 1.69.0
43+
LIBSSH2_VERSION: 1.8.2
44+
LIBUV_VERSION: 1.28.0
45+
OPENSSL_1_0_VERSION: 1.0.2r
46+
OPENSSL_1_1_VERSION: 1.1.1b
4747
matrix:
4848
- CMAKE_GENERATOR: Visual Studio 10 2010
4949
OPENSSL_MAJOR_MINOR: 1.0

build.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ architecture:
1414
os:
1515
- ubuntu/bionic64/cpp
1616
- ubuntu/trusty64/cpp
17-
- ubuntu/xenial64
18-
- centos/6-64
19-
- centos/7-64
17+
- ubuntu/xenial64/cpp
18+
- centos/6-64/cpp
19+
- centos/7-64/cpp
2020
- osx/high-sierra
2121
env:
22-
LIBUV_VERSION: 1.24.0
22+
LIBUV_VERSION: 1.26.0
2323
build:
2424
- script: |
2525
. .build.sh

cmake/modules/ExternalProject-Boost.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if(NOT BOOST_INSTALL_PREFIX)
2323
endif()
2424
option(BOOST_VERSION "Boost version to build and install")
2525
if(NOT BOOST_VERSION)
26-
set(BOOST_VERSION "1.68.0")
26+
set(BOOST_VERSION "1.69.0")
2727
endif()
2828
set(BOOST_VERSION ${BOOST_VERSION} CACHE STRING "Boost version to build and install" FORCE)
2929

cmake/modules/ExternalProject-OpenSSL.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ endif()
2121
# OpenSSL related CMake options
2222
option(OPENSSL_VERSION "OpenSSL version to build and install")
2323
if(NOT OPENSSL_VERSION)
24-
# TODO: Should we default to OpenSSL 1.1 (e.g. 1.1.1a)?
25-
set(OPENSSL_VERSION "1.0.2q")
24+
# TODO: Should we default to OpenSSL 1.1 (e.g. 1.1.1b)?
25+
set(OPENSSL_VERSION "1.0.2r")
2626
endif()
2727
option(OPENSSL_INSTALL_PREFIX "OpenSSL installation prefix location")
2828
if(CASS_USE_ZLIB)

cmake/modules/ExternalProject-libssh2.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if(NOT LIBSSH2_INSTALL_PREFIX)
2222
endif()
2323
option(LIBSSH2_VERSION "libssh2 version to build and install")
2424
if(NOT LIBSSH2_VERSION)
25-
set(LIBSSH2_VERSION "1.8.0")
25+
set(LIBSSH2_VERSION "1.8.2")
2626
endif()
2727
set(LIBSSH2_VERSION ${LIBSSH2_VERSION} CACHE STRING "libssh2 version to build and install" FORCE)
2828

cmake/modules/ExternalProject-libuv.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if(NOT LIBUV_INSTALL_PREFIX)
2222
endif()
2323
option(LIBUV_VERSION "libuv version to build and install")
2424
if(NOT LIBUV_VERSION)
25-
set(LIBUV_VERSION "1.24.0")
25+
set(LIBUV_VERSION "1.28.0")
2626
endif()
2727
set(LIBUV_VERSION ${LIBUV_VERSION} CACHE STRING "libuv version to build and install" FORCE)
2828

docs.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ rules:
5656
use_path_nav_files_only: true
5757

5858
versions:
59+
- name: "2.12"
60+
ref: 2.12.0
5961
- name: "2.11"
6062
ref: 2.11.0
6163
- name: "2.10"

examples/host_listener/host_listener.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ void on_host_listener(CassHostListenerEvent event, CassInet inet, void* data) {
7272
cass_inet_string(inet, address);
7373
if (event == CASS_HOST_LISTENER_EVENT_ADD) {
7474
printf("Host %s has been ADDED\n", address);
75-
} else if (event == CASS_HOST_LISTENER_EVENT_REMOVE) {
75+
} else if (event == CASS_HOST_LISTENER_EVENT_REMOVE) {
7676
printf("Host %s has been REMOVED\n", address);
77-
} else if (event == CASS_HOST_LISTENER_EVENT_UP) {
77+
} else if (event == CASS_HOST_LISTENER_EVENT_UP) {
7878
printf("Host %s is UP\n", address);
79-
} else if (event == CASS_HOST_LISTENER_EVENT_DOWN) {
79+
} else if (event == CASS_HOST_LISTENER_EVENT_DOWN) {
8080
printf("Host %s is DOWN\n", address);
81-
}
81+
}
8282
}
8383

8484
int main(int argc, char* argv[]) {

gtests/src/integration/integration.cpp

+30-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "integration.hpp"
1818
#include "options.hpp"
1919

20+
#include <algorithm>
2021
#include <cstdarg>
2122
#include <iostream>
2223
#include <sys/stat.h>
@@ -60,7 +61,12 @@ Integration::Integration()
6061
, create_keyspace_query_("")
6162
, start_time_(0ull) {
6263
// Determine if the schema keyspaces table should be updated
63-
if (server_version_ >= "3.0.0") {
64+
// TODO: Make cass_version (and dse_version) available for all tests
65+
CCM::CassVersion cass_version = server_version_;
66+
if (Options::is_dse()) {
67+
cass_version = static_cast<CCM::DseVersion>(cass_version).get_cass_version();
68+
}
69+
if (cass_version >= "3.0.0") {
6470
system_schema_keyspaces_ = "system_schema.keyspaces";
6571
}
6672

@@ -391,13 +397,31 @@ bool Integration::force_decommission_node(unsigned int node) {
391397
return decommission_node(node, true);
392398
}
393399

394-
bool Integration::stop_node(unsigned int node) {
400+
bool Integration::start_node(unsigned int node) {
395401
// Stop the requested node
396-
bool status = ccm_->stop_node(node);
397-
if (status) {
398-
stopped_nodes_.push_back(node);
402+
if (ccm_->is_node_down(node, true)) {
403+
bool status = ccm_->start_node(node);
404+
std::vector<unsigned int>::iterator it = std::find(stopped_nodes_.begin(),
405+
stopped_nodes_.end(),
406+
node);
407+
if (it != stopped_nodes_.end()) {
408+
stopped_nodes_.erase(it);
409+
}
410+
return status;
399411
}
400-
return status;
412+
return false;
413+
}
414+
415+
bool Integration::stop_node(unsigned int node, bool is_kill /*= false*/) {
416+
// Stop the requested node
417+
if (ccm_->is_node_up(node, true)) {
418+
bool status = ccm_->stop_node(node, is_kill);
419+
if (status) {
420+
stopped_nodes_.push_back(node);
421+
}
422+
return status;
423+
}
424+
return false;
401425
}
402426

403427
std::string Integration::generate_contact_points(const std::string& ip_prefix,

gtests/src/integration/integration.hpp

+19-3
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@
9999
}
100100

101101
#define CHECK_VALUE_TYPE_VERSION(type) \
102-
if (this->server_version_ < type::supported_server_version()) { \
103-
SKIP_TEST_VERSION(this->server_version_.to_string(), \
102+
CCM::CassVersion cass_version = this->server_version_; \
103+
if (Options::is_dse()) { \
104+
cass_version = static_cast<CCM::DseVersion>(cass_version).get_cass_version(); \
105+
} \
106+
if (cass_version < type::supported_server_version()) { \
107+
SKIP_TEST_VERSION(cass_version.to_string(), \
104108
type::supported_server_version()) \
105109
}
106110

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

430+
/**
431+
* Start a node that was previously stopped to ensure that it is not restarted
432+
* after test is completed
433+
*
434+
* @param node Node that should be started
435+
* @return True if node was started; false otherwise (the node is invalid or
436+
* was already started)
437+
*/
438+
virtual bool start_node(unsigned int node);
439+
426440
/**
427441
* Stop a node that should be restarted after test is completed
428442
*
429443
* @param node Node that should be stopped
444+
* @param is_kill True if forced termination requested; false otherwise
445+
* (default: false)
430446
* @return True if node was stopped; false otherwise (the node is invalid or
431447
* was already stopped)
432448
*/
433-
virtual bool stop_node(unsigned int node);
449+
virtual bool stop_node(unsigned int node, bool is_kill = false);
434450

435451
/**
436452
* Generate the contact points for the cluster

gtests/src/integration/objects/user_type.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ class UserType : public Object<CassUserType, cass_user_type_free> {
198198
}
199199

200200
// Create the user type from the data type
201-
Object::set(cass_user_type_new_from_data_type(data_type));
201+
Object<CassUserType, cass_user_type_free>::set(
202+
cass_user_type_new_from_data_type(data_type));
202203
}
203204
};
204205

gtests/src/integration/policies/ignore_retry_policy.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class IgnoreRetryPolicy : public cass::DefaultRetryPolicy {
3838
* @return Driver ready retry policy
3939
*/
4040
static ::test::driver::RetryPolicy policy() {
41-
cass::RetryPolicy* policy = cass::Memory::allocate<IgnoreRetryPolicy>();
41+
cass::RetryPolicy* policy = new IgnoreRetryPolicy();
4242
policy->inc_ref();
4343
return CassRetryPolicy::to(policy);
4444
}

gtests/src/integration/policies/next_host_retry_policy.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class NextHostRetryPolicy : public cass::DefaultRetryPolicy {
3838
* @return Driver ready retry policy
3939
*/
4040
static ::test::driver::RetryPolicy policy() {
41-
cass::RetryPolicy* policy = cass::Memory::allocate<NextHostRetryPolicy>();
41+
cass::RetryPolicy* policy = new NextHostRetryPolicy();
4242
policy->inc_ref();
4343
return CassRetryPolicy::to(policy);
4444
}

gtests/src/integration/shared_ptr.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class SharedPtr {
6262
SharedPtr(T* ptr = NULL)
6363
: object_(NULL) {
6464
if (ptr) {
65-
ObjectRef<T, D>* object_ref = cass::Memory::allocate<ObjectRef<T, D> >(ptr);
65+
ObjectRef<T, D>* object_ref = new ObjectRef<T, D>(ptr);
6666
object_ = cass::SharedRefPtr<ObjectRef<T, D> >(object_ref);
6767
}
6868
}

gtests/src/integration/simulacron/priming_requests.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Request {
3939
};
4040

4141
Request()
42-
: then_(cass::Memory::allocate<Success>()) { };
42+
: then_(new Success()) { };
4343

4444
/**
4545
* Generate the JSON for the priming request

gtests/src/integration/simulacron/simulacron_integration.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ SimulacronIntegration::~SimulacronIntegration() {
3333

3434
void SimulacronIntegration::SetUpTestCase() {
3535
try {
36-
sc_ = cass::Memory::allocate<test::SimulacronCluster>();
36+
sc_ = new test::SimulacronCluster();
3737
} catch (SimulacronCluster::Exception scce) {
3838
TEST_LOG_ERROR(scce.what());
3939
}

gtests/src/integration/tests/simulacron/test_simulacron_idempotent.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ SIMULACRON_INTEGRATION_TEST_F(IdempotentTest, WriteTimeoutNonIdempotentNoRetry)
7979
SKIP_TEST_IF_SIMULACRON_UNAVAILABLE;
8080

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

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

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

113113
// Loop through all the nodes in the cluster execute the mock query
114114
bool was_node_one_attempted = false;
@@ -141,7 +141,7 @@ SIMULACRON_INTEGRATION_TEST_F(IdempotentTest, ClosedConnectionNonIdempotentNoRet
141141
SKIP_TEST_IF_SIMULACRON_UNAVAILABLE;
142142

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

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

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

176176
// Loop through all the nodes in the cluster execute the mock query
177177
bool was_node_one_attempted = false;

gtests/src/integration/tests/test_auth.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ CASSANDRA_INTEGRATION_TEST_F(AuthenticationTests, BadCredentials) {
203203
CHECK_FAILURE;
204204

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

243247
// Add the proper logging criteria (based on server version)
244-
if (server_version_ >= "3.10") {
248+
CCM::CassVersion cass_version = this->server_version_;
249+
if (Options::is_dse()) {
250+
cass_version = static_cast<CCM::DseVersion>(cass_version).get_cass_version();
251+
}
252+
if (cass_version >= "3.10") {
245253
logger_.add_critera("Provided username invalid and/or password are incorrect");
246254
} else {
247255
logger_.add_critera("Username and/or password are incorrect");

0 commit comments

Comments
 (0)