Skip to content

Commit 8bdd02c

Browse files
author
Michael Penick
committed
Merge remote-tracking branch 'core/2.14.1_prep' into 1.10.1_prep
2 parents 4af2425 + 770ddc0 commit 8bdd02c

4 files changed

Lines changed: 58 additions & 12 deletions

File tree

cpp-driver/CHANGELOG.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
1+
2.14.1
2+
===========
3+
4+
Bug Fixes
5+
--------
6+
* [CPP-879] Allow remote hosts to come back up even if policy ignores down hosts
7+
(community PR from kw217)
8+
19
2.14.0
210
===========
311

412
Bug Fixes
513
--------
6-
* [CPP-819] - Ensure port is updated on already assigned contact points
7-
* [CPP-825] - Cloud should be verifying the peer certificates CN
14+
* [CPP-819] Ensure port is updated on already assigned contact points
15+
* [CPP-825] Cloud should be verifying the peer certificates CN
816

917
2.14.0-alpha2
1018
===========
1119

1220
Features
1321
--------
14-
* [CPP-812] - Enable warnings for implicit casts and fix problems
15-
* [CPP-813] - Detect CaaS and change consistency default
16-
* [CPP-817] - Provide error if mixed usage of secure connect bundle and contact points/ssl context
22+
* [CPP-812] Enable warnings for implicit casts and fix problems
23+
* [CPP-813] Detect CaaS and change consistency default
24+
* [CPP-817] Provide error if mixed usage of secure connect bundle and contact points/ssl context
1725

1826
Bug Fixes
1927
--------
20-
* [CPP-802] - Handle prepared id mismatch when repreparing on the fly
21-
* [CPP-815] - Schema agreement fails with SNI
22-
* [CPP-811] - Requests won't complete if they exceed the number of streams on a connection
28+
* [CPP-802] Handle prepared id mismatch when repreparing on the fly
29+
* [CPP-815] Schema agreement fails with SNI
30+
* [CPP-811] Requests won't complete if they exceed the number of streams on a connection
2331

2432
2.14.0-alpha
2533
===========

cpp-driver/include/cassandra.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
#define CASS_VERSION_MAJOR 2
5555
#define CASS_VERSION_MINOR 14
56-
#define CASS_VERSION_PATCH 0
56+
#define CASS_VERSION_PATCH 1
5757
#define CASS_VERSION_SUFFIX ""
5858

5959
#ifdef __cplusplus

cpp-driver/src/request_processor.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,7 @@ void RequestProcessor::internal_host_ready(const Host::Ptr& host) {
462462
LoadBalancingPolicy::Vec policies = load_balancing_policies();
463463
for (LoadBalancingPolicy::Vec::const_iterator it = policies.begin(); it != policies.end();
464464
++it) {
465-
if ((*it)->distance(host) != CASS_HOST_DISTANCE_IGNORE) {
466-
(*it)->on_host_up(host);
467-
}
465+
(*it)->on_host_up(host);
468466
}
469467
}
470468
}

cpp-driver/tests/src/unit/tests/test_session.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,46 @@ TEST_F(SessionUnitTest, DefaultConsistencyExecutionProfileNotUpdated) {
935935
close(&session);
936936
}
937937

938+
TEST_F(SessionUnitTest, RemoteDCNodeRecovery) {
939+
mockssandra::SimpleCluster cluster(simple(), 1, 1); // 1 local DC node and 1 remote DC node
940+
ASSERT_EQ(cluster.start_all(), 0);
941+
942+
ExecutionProfile profile;
943+
Config config;
944+
config.set_constant_reconnect(100); // Faster reconnect time to handle node outages
945+
config.contact_points().push_back(Address("127.0.0.1", 9042));
946+
config.set_load_balancing_policy(new DCAwarePolicy("dc1", 1));
947+
948+
Session session;
949+
connect(config, &session);
950+
951+
cluster.stop(1); // Force using the remote node
952+
953+
cluster.stop(2); // Force the remote node down and up
954+
cluster.start(2);
955+
956+
bool remote_dc_node_recovered = false;
957+
958+
// Wait for the remote DC node to become available
959+
for (int i = 0; i < 20; ++i) { // Around 2 seconds
960+
QueryRequest::Ptr request(new QueryRequest("blah", 0));
961+
request->set_consistency(CASS_CONSISTENCY_ONE); // Don't use a LOCAL consistency
962+
request->set_record_attempted_addresses(true);
963+
ResponseFuture::Ptr future = session.execute(request, NULL);
964+
EXPECT_TRUE(future->wait_for(WAIT_FOR_TIME));
965+
if (!future->error() && !future->attempted_addresses().empty() &&
966+
Address("127.0.0.2", 9042) == future->attempted_addresses()[0]) {
967+
remote_dc_node_recovered = true;
968+
break;
969+
}
970+
test::Utils::msleep(100);
971+
}
972+
973+
EXPECT_TRUE(remote_dc_node_recovered);
974+
975+
close(&session);
976+
}
977+
938978
TEST_F(SessionUnitTest, DbaasDetectionUpdateDefaultConsistency) {
939979
mockssandra::SimpleRequestHandlerBuilder builder;
940980
builder.on(mockssandra::OPCODE_OPTIONS).execute(new SupportedDbaasOptions());

0 commit comments

Comments
 (0)