Skip to content
Merged

2.5 #326

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c9041a6
Added host targeting policy and refactored external types
mpenick Sep 1, 2016
8c2e826
Fix: Connection incorrectly marked READY after being marked DEFUNCT
mpenick Sep 1, 2016
52d422b
Improvement: Removed redundant call and better error handling
mpenick Sep 1, 2016
588414c
test: Updating CCM bridge functionality and adding features
Sep 13, 2016
de93318
Renamed 'Handler' to 'RequestCallback'
mpenick Sep 13, 2016
8002606
Fixing build and correcting tests due to refactor
Sep 14, 2016
475fcc0
test: Adding the ability to use an installed version of Cassandra/DSE
Sep 14, 2016
01f84ad
Fix: Aliasing issues and cleanup in cass::Address
mpenick Sep 20, 2016
e8f93b8
Fix: Remove invalid uses of copy_cast<> for libuv pointer aliasing
mpenick Sep 20, 2016
49c0004
Improvement: Moved mutating 'addr' access methods to be private
mpenick Sep 20, 2016
1cfbe00
Improvement: SharedRefPtr<> cleanup
mpenick Sep 22, 2016
1ce7719
Improvement: Remove executing future callbacks on thread pool
mpenick Sep 28, 2016
de22707
Feature: Added a function for creating an SSL context without initial…
mpenick Oct 5, 2016
a8b90b1
Speculative execution
mpenick Sep 28, 2016
9d89267
Merge branch '399' into 2.5
mpenick Oct 10, 2016
e5bd459
Merge branch '401' into 2.5
mpenick Oct 10, 2016
d3f87d2
Merge branch '374' into 2.5
mpenick Oct 10, 2016
a27bbc5
Merge branch '406' into 2.5
mpenick Oct 10, 2016
6ace525
Merge branch '328' into 2.5
mpenick Oct 10, 2016
11451ff
Fix: Random partitioner hash values should be in the range [1, 2^127-1]
mpenick Oct 11, 2016
3a062ab
Fixing invalidation issue when resolving peer host addresses
Oct 11, 2016
abc5496
Added attempted addresses for internal use
mpenick Oct 11, 2016
4a82e48
test: Speculative execution policy integration test
Oct 12, 2016
2752ef6
Fix: Debug logging would cause crash on request timeout
mpenick Oct 13, 2016
5944b8a
Merge branch '403' into 2.5
mpenick Oct 13, 2016
c1a232b
Fix: Request timeouts metric counter and NULL dereference
mpenick Oct 17, 2016
97297c5
test: Fixing issue with load balancing test case failing during full run
Oct 18, 2016
0e3b0fc
Fix: Request timeout of 0 means no timeout
mpenick Oct 18, 2016
f249416
Updating version information for tests and Windows builds
Oct 19, 2016
496fd6d
Updated docs for 2.5 release
mpenick Oct 18, 2016
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
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
2.5.0
===========
October 20, 2016

Features
--------
* Added constant specultive exectution which preemptively runs mutiple of the
same query in an effort to smooth out latency spikes.
* Added idempotent queries to support speculative execution and allow automatic
retries. Use `cass_statement_set_is_idempotent()` or
`cass_batch_set_is_idempotent()`.
* SSL can be now be used without initializing the underlying implmentation
(e.g. OpenSSL). Use `cass_ssl_new_no_lib_init()`.

Other
--------
* Fixed an issue where a connection is incorrectly marked READY after it''s
already been marked DEFUNCT (CPP-401)
* Fixed pointer aliasing issues in `cass::Address` (CPP-406)
* Fixed an issue where random partitioner hash values were being incorrectly
generated (CPP-403)

2.4.3
===========
August 22, 2016
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@ Cassandra's native protocol and Cassandra Query Language v3.
- Mailing List: https://groups.google.com/a/lists.datastax.com/forum/#!forum/cpp-driver-user
- IRC: [#datastax-drivers on `irc.freenode.net <http://freenode.net>`](http://webchat.freenode.net/?channels=datastax-drivers)

## What's New in 2.3 and 2.4
## What's New in 2.5

- Support for materialized view and secondary index metadata
- Support for clustering key order, `frozen<>` and Cassandra version metadata
- [Blacklist], [whitelist DC], and [blacklist DC] load balancing policies
- [Custom] authenticators
- [Reverse DNS] with SSL peer identity verification support
- Randomized contact points
- [Speculative execution]
- [Idempotent statements]
- [SSL] can be enabled without re-initializing the underlying library (e.g. OpenSSL)

More information about features included in 2.3 can be found in this [blog
post](http://www.datastax.com/dev/blog/datastax-c-driver-2-3-ga-released).
Expand Down Expand Up @@ -58,6 +55,13 @@ There were a couple breaking API changes between 1.0 and 2.0 that are documented
- [Client-side timestamps]
- [Data types]
- [Idle connection heartbeats]
- Support for materialized view and secondary index metadata
- Support for clustering key order, `frozen<>` and Cassandra version metadata
- [Blacklist], [whitelist DC], and [blacklist DC] load balancing policies
- [Custom] authenticators
- [Reverse DNS] with SSL peer identity verification support
- Randomized contact points


## Compatibility

Expand Down Expand Up @@ -208,3 +212,5 @@ limitations under the License.
[blacklist DC]: http://datastax.github.io/cpp-driver/topics/configuration/#datacenter
[Custom]: http://datastax.github.io/cpp-driver/topics/security/#custom
[Reverse DNS]: http://datastax.github.io/cpp-driver/topics/security/ssl/#enabling-cassandra-identity-verification
[Speculative execution]: http://datastax.github.io/cpp-driver/topics/configuration/#speculative-execution
[Idempotent statements]: http://datastax.github.io/cpp-driver/topics/configuration/#query-idempotence
2 changes: 1 addition & 1 deletion cmake/modules/CppDriver.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ macro(CassAddIncludes)
${CASS_SOURCE_DIR}/src/third_party/sparsehash/src
${CASS_INCLUDES}
)
add_subdirectory(src/third_party/sparsehash)
add_subdirectory(${CASS_SOURCE_DIR}/src/third_party/sparsehash)
endmacro()

#------------------------
Expand Down
14 changes: 8 additions & 6 deletions docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ rewrites:
- http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm: http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
- http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm: http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
versions:
- name: v2.4
- name: 2.5
ref: HEAD
- name: v2.3
- name: 2.4
ref: 2b94bd1119c4bc6e005ce191cf7ec0fba6d823e9
- name: 2.3
ref: 6f72bb8b5bd251e63846ebc9f0fba7adbc8c7e72
- name: v2.2
- name: 2.2
ref: b4bb435129bab533612fa2caf194555fa943f925
- name: v2.1
- name: 2.1
ref: 2c97015988e0a9e9342b233db5f37ca9386e4d7d
- name: v2.0
- name: 2.0
ref: fc9c25a3db879894d40306642864413ef8f7d979
- name: v1.0
- name: 1.0
ref: b2146f44ba5df28e37af28031f7609342023b329
26 changes: 18 additions & 8 deletions examples/perf/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ CassCluster* create_cluster(const char* hosts) {

CassError connect_session(CassSession* session, const CassCluster* cluster) {
CassError rc = CASS_OK;
CassFuture* future = cass_session_connect_keyspace(session, cluster, "examples");
CassFuture* future = cass_session_connect(session, cluster);

cass_future_wait(future);
rc = cass_future_error_code(future);
Expand Down Expand Up @@ -198,6 +198,8 @@ void insert_into_perf(CassSession* session, const char* query, const CassPrepare
statement = cass_statement_new(query, 5);
}

cass_statement_set_is_idempotent(statement, cass_true);

cass_uuid_gen_time(uuid_gen, &id);
cass_statement_bind_uuid(statement, 0, id);
cass_statement_bind_string(statement, 1, big_string);
Expand Down Expand Up @@ -227,7 +229,7 @@ void run_insert_queries(void* data) {
CassSession* session = (CassSession*)data;

const CassPrepared* insert_prepared = NULL;
const char* insert_query = "INSERT INTO songs (id, title, album, artist, tags) VALUES (?, ?, ?, ?, ?);";
const char* insert_query = "INSERT INTO stress.songs (id, title, album, artist, tags) VALUES (?, ?, ?, ?, ?);";

#if USE_PREPARED
if (prepare_query(session, insert_query, &insert_prepared) == CASS_OK) {
Expand Down Expand Up @@ -256,6 +258,8 @@ void select_from_perf(CassSession* session, const char* query, const CassPrepare
statement = cass_statement_new(query, 0);
}

cass_statement_set_is_idempotent(statement, cass_true);

futures[i] = cass_session_execute(session, statement);

cass_statement_free(statement);
Expand All @@ -279,7 +283,7 @@ void run_select_queries(void* data) {
int i;
CassSession* session = (CassSession*)data;
const CassPrepared* select_prepared = NULL;
const char* select_query = "SELECT * FROM songs WHERE id = a98d21b2-1900-11e4-b97b-e5e358e71e0d";
const char* select_query = "SELECT * FROM stress.songs WHERE id = a98d21b2-1900-11e4-b97b-e5e358e71e0d";

#if USE_PREPARED
if (prepare_query(session, select_query, &select_prepared) == CASS_OK) {
Expand All @@ -301,7 +305,6 @@ int main(int argc, char* argv[]) {
uv_thread_t threads[NUM_THREADS];
CassCluster* cluster = NULL;
CassSession* session = NULL;
CassFuture* close_future = NULL;
char* hosts = "127.0.0.1";
if (argc > 1) {
hosts = argv[1];
Expand All @@ -321,8 +324,17 @@ int main(int argc, char* argv[]) {
return -1;
}

execute_query(session, "DROP KEYSPACE stress");

execute_query(session, "CREATE KEYSPACE IF NOT EXISTS stress WITH "
"replication = { 'class': 'SimpleStrategy', 'replication_factor': '3'}");

execute_query(session, "CREATE TABLE IF NOT EXISTS stress.songs (id uuid PRIMARY KEY, "
"title text, album text, artist text, "
"tags set<text>, data blob)");

execute_query(session,
"INSERT INTO songs (id, title, album, artist, tags) VALUES "
"INSERT INTO stress.songs (id, title, album, artist, tags) VALUES "
"(a98d21b2-1900-11e4-b97b-e5e358e71e0d, "
"'La Petite Tonkinoise', 'Bye Bye Blackbird', 'Joséphine Baker', { 'jazz', '2013' });");

Expand Down Expand Up @@ -355,10 +367,8 @@ int main(int argc, char* argv[]) {
uv_thread_join(&threads[i]);
}

close_future = cass_session_close(session);
cass_future_wait(close_future);
cass_future_free(close_future);
cass_cluster_free(cluster);
cass_session_free(session);
cass_uuid_gen_free(uuid_gen);

status_destroy(&status);
Expand Down
98 changes: 94 additions & 4 deletions include/cassandra.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
*/

#define CASS_VERSION_MAJOR 2
#define CASS_VERSION_MINOR 4
#define CASS_VERSION_PATCH 3
#define CASS_VERSION_MINOR 5
#define CASS_VERSION_PATCH 0
#define CASS_VERSION_SUFFIX ""

#ifdef __cplusplus
Expand Down Expand Up @@ -1714,13 +1714,39 @@ cass_cluster_set_use_hostname_resolution(CassCluster* cluster,
* @param[in] cluster
* @param[in] enabled
* @return CASS_OK if successful, otherwise an error occurred
*
* @see cass_cluster_set_resolve_timeout()
*/
CASS_EXPORT CassError
cass_cluster_set_use_randomized_contact_points(CassCluster* cluster,
cass_bool_t enabled);

/**
* Enable constant speculative executions with the supplied settings.
*
* @public @memberof CassCluster
*
* @param[in] cluster
* @param[in] constant_delay_ms
* @param[in] max_speculative_executions
* @return CASS_OK if successful, otherwise an error occurred
*/
CASS_EXPORT CassError
cass_cluster_set_constant_speculative_execution_policy(CassCluster* cluster,
cass_int64_t constant_delay_ms,
int max_speculative_executions);

/**
* Disable speculative executions
*
* <b>Default:</b> This is the default speculative execution policy.
*
* @public @memberof CassCluster
*
* @param[in] cluster
* @return CASS_OK if successful, otherwise an error occurred
*/
CASS_EXPORT CassError
cass_cluster_set_no_speculative_execution_policy(CassCluster* cluster);

/***********************************************************************************
*
* Session
Expand Down Expand Up @@ -3247,6 +3273,37 @@ cass_aggregate_meta_field_by_name_n(const CassAggregateMeta* aggregate_meta,
CASS_EXPORT CassSsl*
cass_ssl_new();

/**
* Creates a new SSL context <b>without</b> initializing the underlying library
* implementation. The integrating application is responsible for
* initializing the underlying SSL implementation. The driver uses the SSL
* implmentation from several threads concurrently so it's important that it's
* properly setup for multithreaded use e.g. lock callbacks for OpenSSL.
*
* <b>Important:</b> The SSL library must be initialized before calling this
* function.
*
* When using OpenSSL the following components need to be initialized:
*
* SSL_library_init();
* SSL_load_error_strings();
* OpenSSL_add_all_algorithms();
*
* The following thread-safety callbacks also need to be set:
*
* CRYPTO_set_locking_callback(...);
* CRYPTO_set_id_callback(...);
*
* @public @memberof CassSsl
*
* @return Returns a SSL context that must be freed.
*
* @see cass_ssl_new()
* @see cass_ssl_free()
*/
CASS_EXPORT CassSsl*
cass_ssl_new_no_lib_init();

/**
* Frees a SSL context instance.
*
Expand Down Expand Up @@ -3938,6 +3995,22 @@ CASS_EXPORT CassError
cass_statement_set_request_timeout(CassStatement* statement,
cass_uint64_t timeout_ms);

/**
* Sets whether the statement is idempotent. Idempotent statements are able to be
* automatically retried after timeouts/errors and can be speculatively executed.
*
* @public @memberof CassStatement
*
* @param[in] statement
* @param[in] is_idempotent
* @return CASS_OK if successful, otherwise an error occurred.
*
* @see cass_cluster_set_constant_speculative_execution_policy()
*/
CASS_EXPORT CassError
cass_statement_set_is_idempotent(CassStatement* statement,
cass_bool_t is_idempotent);

/**
* Sets the statement's retry policy.
*
Expand Down Expand Up @@ -5214,6 +5287,23 @@ CASS_EXPORT CassError
cass_batch_set_request_timeout(CassBatch* batch,
cass_uint64_t timeout_ms);

/**
* Sets whether the statements in a batch are idempotent. Idempotent batches
* are able to be automatically retried after timeouts/errors and can be
* speculatively executed.
*
* @public @memberof CassBatch
*
* @param[in] batch
* @param[in] is_idempotent
* @return CASS_OK if successful, otherwise an error occurred.
*
* @see cass_cluster_set_constant_speculative_execution_policy()
*/
CASS_EXPORT CassError
cass_batch_set_is_idempotent(CassBatch* batch,
cass_bool_t is_idempotent);

/**
* Sets the batch's retry policy.
*
Expand Down
Loading