Skip to content

Commit 0b64ab0

Browse files
committed
Merge branch 'master' into 3.0.1
2 parents 7352be3 + cc29ca8 commit 0b64ab0

Some content is hidden

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

54 files changed

+1765
-446
lines changed

CHANGELOG.md

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
# master
22
Features:
3+
4+
Bug Fixes:
5+
6+
7+
# 3.0.0 GA
8+
Features:
9+
* Increased default request timeout (the `timeout` option to `Cassandra.cluster`), from 10 seconds to 12 seconds
10+
because C* defaults to a 10 second timeout internally. The extra two seconds is buffer so that the client can
11+
report the timeout in the server. This is also consistent with the Java driver.
12+
* Expand :client_timestamps cluster configuration option to allow user to specify his own generator for client timestamps.
13+
14+
Bug Fixes:
15+
* [RUBY-207](https://datastax-oss.atlassian.net/browse/RUBY-207) Get NoMethodError when handling a write-timeout error using a downgrading consistency retry policy.
16+
* [RUBY-214](https://datastax-oss.atlassian.net/browse/RUBY-214) Client timestamps in JRuby are not fine-grained enough, causing timestamp collisions and lost rows in C*.
17+
18+
Breaking Changes:
19+
* The Datacenter-aware load balancing policy (Cassandra::LoadBalancing::Policies::DCAwareRoundRobin) defaults to using
20+
nodes in the local DC only. In prior releases, the policy would fall back to remote nodes after exhausting local nodes.
21+
Specify a positive value (or nil for unlimited) for `max_remote_hosts_to_use` when initializing the policy to allow remote node use.
22+
23+
# 3.0.0 rc2
24+
Features:
325
* Add protocol_version configuration option to allow the user to force the protocol version to use for communication with nodes.
426
* Expose listen_address and broadcast_address in `Cassandra::Host` if available.
527
* Add support for materialized views in the schema metadata.
628
* Add support for Cassandra indexes in the schema metadata.
729
* Add or expose the id, options, keyspace, partition_key, clustering_columns, and clustering_order attributes to table and view schema objects.
830
* Add crc_check_chance and extensions attributes to ColumnContainer options.
31+
* Make cluster configuration options list publicly available. (Thanks, Evan Prothro!)
932

1033
Bug Fixes:
11-
* [RUBY-161] Protocol version negotiation in mixed version clusters should not fall back to v1 unless it is truly warranted.
12-
* [RUBY-180] Column ordering is not deterministic in Table metadata.
13-
* [RUBY-185] Internal columns in static-compact and dense tables should be ignored.
14-
* [RUBY-186] Custom type column metadata should be parsed properly for C* 3.x schemas.
15-
16-
Breaking Changes:
34+
* [RUBY-161](https://datastax-oss.atlassian.net/browse/RUBY-161) Protocol version negotiation in mixed version clusters should not fall back to v1 unless it is truly warranted.
35+
* [RUBY-180](https://datastax-oss.atlassian.net/browse/RUBY-180) Column ordering is not deterministic in Table metadata.
36+
* [RUBY-185](https://datastax-oss.atlassian.net/browse/RUBY-185) Internal columns in static-compact and dense tables should be ignored.
37+
* [RUBY-186](https://datastax-oss.atlassian.net/browse/RUBY-186) Custom type column metadata should be parsed properly for C* 3.x schemas.
1738

1839
# 3.0.0 rc1
1940

@@ -22,9 +43,9 @@ Features:
2243
* Add Cassandra::Logger class to make it easy for users to enable debug logging in the client.
2344

2445
Bug Fixes:
25-
* [RUBY-154] Improve batch request performance, which had regressed in 3.0.0 beta1.
26-
* [RUBY-155] Request timeout timer should not include request queuing time.
27-
* [RUBY-156] Do not drop response frames that follow a frame containing a warning.
46+
* [RUBY-154](https://datastax-oss.atlassian.net/browse/RUBY-154) Improve batch request performance, which had regressed in 3.0.0 beta1.
47+
* [RUBY-155](https://datastax-oss.atlassian.net/browse/RUBY-155) Request timeout timer should not include request queuing time.
48+
* [RUBY-156](https://datastax-oss.atlassian.net/browse/RUBY-156) Do not drop response frames that follow a frame containing a warning.
2849

2950
# 3.0.0 beta1
3051

@@ -44,10 +65,10 @@ Features:
4465

4566
Bug Fixes:
4667

47-
* [RUBY-143] Retry querying system table for metadata of new hosts when prior attempts fail, ultimately enabling use of new hosts.
48-
* [RUBY-150] Fixed a protocol decoding error that occurred when multiple messages are available in a stream.
49-
* [RUBY-151] Decode incomplete UDTs properly.
50-
* [RUBY-120] Tuples and UDTs can be used in sets and hash keys.
68+
* [RUBY-143](https://datastax-oss.atlassian.net/browse/RUBY-143) Retry querying system table for metadata of new hosts when prior attempts fail, ultimately enabling use of new hosts.
69+
* [RUBY-150](https://datastax-oss.atlassian.net/browse/RUBY-150) Fixed a protocol decoding error that occurred when multiple messages are available in a stream.
70+
* [RUBY-151](https://datastax-oss.atlassian.net/browse/RUBY-151) Decode incomplete UDTs properly.
71+
* [RUBY-120](https://datastax-oss.atlassian.net/browse/RUBY-120) Tuples and UDTs can be used in sets and hash keys.
5172

5273
Breaking Changes:
5374

@@ -57,6 +78,12 @@ Breaking Changes:
5778
* Unavailable errors are retried on the next host in the load balancing plan by default.
5879
* Statement execution no longer retried on timeouts, unless `:idempotent => true` has been specified when executing.
5980

81+
# 2.1.6
82+
Bug Fixes:
83+
84+
* [RUBY-202](https://datastax-oss.atlassian.net/browse/RUBY-202) Allow password authenticator to be used for LDAP authentication. This is actually a backport of
85+
RUBY-169 for the 3.0.0 release.
86+
6087
# 2.1.5
6188

6289
Features:
@@ -65,25 +92,25 @@ Features:
6592

6693
Bug Fixes:
6794

68-
* [RUBY-128] Fix decoding of large values in maps, sets and lists.
95+
* [RUBY-128](https://datastax-oss.atlassian.net/browse/RUBY-128) Fix decoding of large values in maps, sets and lists.
6996

7097
# 2.1.4
7198

7299
Features:
73100

74-
* [RUBY-119] Use `require 'datastax/cassandra'` to avoid namespace conflicts
75-
* [RUBY-90] Add support for disabling nagle algorithm (tcp nodelay), enabled by default.
76-
* [RUBY-70] Add support for client-side timestamps, disabled by default.
77-
* [RUBY-114] Add support for serial consistency in batch requests.
101+
* [RUBY-119](https://datastax-oss.atlassian.net/browse/RUBY-119) Use `require 'datastax/cassandra'` to avoid namespace conflicts
102+
* [RUBY-90](https://datastax-oss.atlassian.net/browse/RUBY-90) Add support for disabling nagle algorithm (tcp nodelay), enabled by default.
103+
* [RUBY-70](https://datastax-oss.atlassian.net/browse/RUBY-70) Add support for client-side timestamps, disabled by default.
104+
* [RUBY-114](https://datastax-oss.atlassian.net/browse/RUBY-114) Add support for serial consistency in batch requests.
78105

79106
Bug Fixes:
80107

81-
* [RUBY-103] Don't regenerate schema metadata for the same replication
108+
* [RUBY-103](https://datastax-oss.atlassian.net/browse/RUBY-103) Don't regenerate schema metadata for the same replication
82109
strategies and options
83-
* [RUBY-102] Allow custom types in schema metadata
84-
* [RUBY-97] Allow disabling of the initial population of schema metadata
85-
* [RUBY-95] Speed up generation of large token maps
86-
* [RUBY-116] fix thread leak on connection error
110+
* [RUBY-102](https://datastax-oss.atlassian.net/browse/RUBY-102) Allow custom types in schema metadata
111+
* [RUBY-97](https://datastax-oss.atlassian.net/browse/RUBY-97) Allow disabling of the initial population of schema metadata
112+
* [RUBY-95](https://datastax-oss.atlassian.net/browse/RUBY-95) Speed up generation of large token maps
113+
* [RUBY-116](https://datastax-oss.atlassian.net/browse/RUBY-116) fix thread leak on connection error
87114

88115
Breaking Changes:
89116

@@ -102,7 +129,7 @@ Release removing accidental debug code from 2.1.1.
102129

103130
Bug Fixes:
104131

105-
* [RUBY-98] Use of undefined class variable in `Table#create_partition_key`
132+
* [RUBY-98](https://datastax-oss.atlassian.net/browse/RUBY-98) Use of undefined class variable in `Table#create_partition_key`
106133

107134
# 2.1.0
108135

@@ -120,13 +147,13 @@ Breaking Changes:
120147

121148
Bug Fixes:
122149

123-
* [RUBY-93] Reconnection can overflow the stack
150+
* [RUBY-93](https://datastax-oss.atlassian.net/browse/RUBY-93) Reconnection can overflow the stack
124151

125152
# 2.0.1
126153

127154
Bug Fixes:
128155

129-
* [RUBY-87] Decoder corrupts incomplete response buffer
156+
* [RUBY-87](https://datastax-oss.atlassian.net/browse/RUBY-87) Decoder corrupts incomplete response buffer
130157

131158
# 2.0.0
132159

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
cassandra-driver (3.0.1)
4+
cassandra-driver (3.0.1.beta.1)
55
ione (~> 1.2)
66

77
GEM

README.md

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Datastax Ruby Driver for Apache Cassandra
22

3-
*If you're reading this on GitHub, please note that this is the readme for the development version and that some features described here might not yet have been released. You can [find the documentation for latest version through ruby driver docs](http://datastax.github.io/ruby-driver/) or via the release tags, [e.g. v1.0.0-beta.3](https://github.com/datastax/ruby-driver/tree/v1.0.0-beta.3).*
3+
*If you're reading this on GitHub, please note that this is the readme for the development version and that some features described here might not yet have been released. You can [find the documentation for latest version through ruby driver docs](http://datastax.github.io/ruby-driver/) or via the release tags, [e.g. v3.0.0](https://github.com/datastax/ruby-driver/tree/v3.0.0).*
44

55
[![Build Status](https://travis-ci.org/datastax/ruby-driver.svg?branch=master)](https://travis-ci.org/datastax/ruby-driver)
66

@@ -31,8 +31,8 @@ This driver is based on [the cql-rb gem](https://github.com/iconara/cql-rb) by [
3131

3232
This driver works exclusively with the Cassandra Query Language v3 (CQL3) and Cassandra's native protocol. The current version works with:
3333

34-
* Apache Cassandra versions 1.2, 2.0, 2.1, and 3.x
35-
* DataStax Enterprise 4.0, 4.5, 4.6, 4.7, and 4.8
34+
* Apache Cassandra versions 1.2, 2.0, 2.1, 2.2, and 3.x
35+
* DataStax Enterprise 4.0 and above.
3636
* Ruby (MRI) 2.2, 2.3
3737
* JRuby 1.7
3838

@@ -96,28 +96,33 @@ Some of the new features added to the driver have unfortunately led to changes i
9696

9797
### Features:
9898

99-
* Apache Cassandra native protocol v4
100-
* Add support for smallint, tinyint, date (Cassandra::Date) and time (Cassandra::Time) data types.
99+
* Add support for Apache Cassandra native protocol v4
100+
* Add support for smallint, tinyint, date (`Cassandra::Date`) and time (`Cassandra::Time`) data types.
101101
* Include schema metadata for User Defined Functions and User Defined Aggregates.
102+
* Augment the `Cassandra::Table` object to expose many more attributes: `id`, `options`, `keyspace`, `partition_key`, `clustering_columns`, and `clustering_order`. This makes it significantly easier to write administration scripts that report various attributes of your schema, which may help to highlight areas for improvement.
102103
* Include client ip addresses in request traces, only on Cassandra 3.x.
103-
* Add new retry policy decision Cassandra::Retry::Policy#try_next_host.
104-
* Support specifying statement idempotence with the new :idempotent option when executing.
105-
* Support sending custom payloads when preparing or executing statements using the new :payload option.
106-
* Expose custom payloads received with responses on server exceptions and Cassandra::Execution::Info instances.
107-
* Expose server warnings on server exceptions and Cassandra::Execution::Info instances.
108-
* Add connections_per_local_node, connections_per_remote_node, requests_per_connection cluster configuration options to tune parallel query execution and resource usage.
109-
* Add Cassandra::Logger class to make it easy for users to enable debug logging in the client.
110-
* Add protocol_version configuration option to allow the user to force the protocol version to use for communication with nodes.
111-
* Add support for materialized views in the schema metadata.
112-
113-
### Breaking Changes:
114-
115-
* Cassandra::Future#join is now an alias to Cassandra::Future#get and will raise an error if the future is resolved with one.
104+
* Add new retry policy decision `Cassandra::Retry::Policy#try_next_host`.
105+
* Support specifying statement idempotence with the new `idempotent` option when executing.
106+
* Support sending custom payloads when preparing or executing statements using the new `payload` option.
107+
* Expose custom payloads received with responses on server exceptions and `Cassandra::Execution::Info` instances.
108+
* Expose server warnings on server exceptions and `Cassandra::Execution::Info` instances.
109+
* Add `connections_per_local_node`, `connections_per_remote_node`, `requests_per_connection` cluster configuration options to tune parallel query execution and resource usage.
110+
* Add `Cassandra::Logger` class to make it easy for users to enable debug logging in the client.
111+
* Add `protocol_version` configuration option to allow the user to force the protocol version to use for communication with nodes.
112+
* Add support for materialized views and indexes in the schema metadata.
113+
* Support the `ReadError`, `WriteError`, and `FunctionCallError` Cassandra error responses introduced in Cassandra 2.2.
114+
* Add support for unset variables in bound statements.
115+
* Support DSE security (`DseAuthenticator`, configured for LDAP).
116+
* Add a timeout option to `Cassandra::Future#get`.
117+
118+
### Breaking Changes from 2.x:
119+
120+
* `Cassandra::Future#join` is now an alias to Cassandra::Future#get and will raise an error if the future is resolved with one.
116121
* Default consistency level is now LOCAL_ONE.
117122
* Enable tcp no-delay by default.
118123
* Unavailable errors are retried on the next host in the load balancing plan by default.
119-
* Statement execution no longer retried on timeouts, unless :idempotent => true has been specified when executing.
120-
* Cassandra::Statements::Batch#add signature has changed in how one specifies query parameters. Specify the query parameters array as the value of the arguments key:
124+
* Statement execution no longer retried on timeouts, unless the statement is marked as idempotent in the call to `Cassandra::Session#execute*` or when creating a `Cassandra::Statement` object.
125+
* `Cassandra::Statements::Batch#add` and `Cassandra::Session#execute*` signatures have changed in how one specifies query parameters. Specify the query parameters array as the value of the arguments key:
121126

122127
```ruby
123128
batch.add(query, ['val1', 'val2'])
@@ -128,19 +133,24 @@ batch.add(query, {p1: 'val1'})
128133
# becomes
129134
batch.add(query, arguments: {p1: 'val1'})
130135
```
136+
* The Datacenter-aware load balancing policy (`Cassandra::LoadBalancing::Policies::DCAwareRoundRobin`) defaults to using
137+
nodes in the local DC only. In prior releases, the policy would fall back to remote nodes after exhausting local nodes.
138+
Specify a positive value (or nil for unlimited) for `max_remote_hosts_to_use` when initializing the policy to allow remote node use.
139+
* Unspecified variables in statements previously resulted in an exception. Now they are essentially ignored or treated as null.
131140

132141
### Bug Fixes:
133142

134143
* [[RUBY-120](https://datastax-oss.atlassian.net/browse/RUBY-120)] Tuples and UDTs can be used in sets and hash keys.
135144
* [[RUBY-143](https://datastax-oss.atlassian.net/browse/RUBY-143)] Retry querying system table for metadata of new hosts when prior attempts fail, ultimately enabling use of new hosts.
136145
* [[RUBY-150](https://datastax-oss.atlassian.net/browse/RUBY-150)] Fixed a protocol decoding error that occurred when multiple messages are available in a stream.
137146
* [[RUBY-151](https://datastax-oss.atlassian.net/browse/RUBY-151)] Decode incomplete UDTs properly.
138-
* [[RUBY-161](https://datastax-oss.atlassian.net/browse/RUBY-161)] Protocol version negotiation in mixed version clusters should not fall back to v1 unless it is truly warranted.
147+
* [[RUBY-155](https://datastax-oss.atlassian.net/browse/RUBY-155)] Request timeout timer should not include request queuing time.
148+
* [[RUBY-161](https://datastax-oss.atlassian.net/browse/RUBY-161)] Protocol version negotiation in mixed version clusters should not fall back to v1 unless it is truly warranted.
149+
* [[RUBY-214](https://datastax-oss.atlassian.net/browse/RUBY-214)] Ensure client timestamps have microsecond precision in JRuby. Previously, some row updates would get lost in high transaction environments.
139150

140151
## Feedback Requested
141152

142-
*Help us focus our efforts!* [Provide your input](http://goo.gl/forms/pCs8PTpHLf)
143-
on the Ruby Driver Platform and Runtime Survey (we kept it short).
153+
*Help us focus our efforts!* [Provide your input](http://goo.gl/forms/pCs8PTpHLf) on the Ruby Driver Platform and Runtime Survey (we kept it short).
144154

145155
## Code examples
146156

Rakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ Rake::TestTask.new(:integration => :compile) do |t|
3535
'integration/security/*_test.rb',
3636
'integration/load_balancing/*_test.rb',
3737
'integration/types/*_test.rb',
38-
'integration/functions/*_test.rb']
38+
'integration/functions/*_test.rb',
39+
'integration/indexes/*_test.rb']
3940
t.verbose = true
4041
end
4142

docs.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ links:
3737
- title: Releases
3838
href: https://github.com/datastax/ruby-driver/releases
3939
versions:
40-
- name: v3.0.0.rc.1
41-
ref: c8ed32ce85b608f172e72133dd68c3e2af34db00
42-
- name: v3.0.0.beta.1
43-
ref: a0a5f7a5cc308497e5e865f008130441722208e5
44-
- name: v2.1.5
45-
ref: bbb7084d11be701ff42f298373c0255b9a3e2b7f
40+
- name: v3.0.0
41+
ref: 0ef47aaac0253c2cdd23ab487b3a66789416f1cb
42+
- name: v2.1.6
43+
ref: 474568501e5ef771a496c3a901f3cbdc3854f512
4644
- name: v2.0.1
4745
ref: 80cab0ad188511ec16eb39111c0b67329c754729
4846
- name: v1.2.0

features/basics/client_side_timestamps.feature

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ Feature: Client-side Timestamps
2323
require 'cassandra'
2424
require 'delorean'
2525
26-
cluster = Cassandra.cluster(client_timestamps: true)
26+
# Enable client-side timestamps. Valid values:
27+
# nil / false : don't enable client-side timestamps. This is the default.
28+
# true : enable client-side timestamps and use the default timestamp generator for the Ruby flavor being used:
29+
# JRuby - Cassandra::TimestampGenerator::TickingOnDuplicate
30+
# MRI/Rubinius - Cassandra::TimestampGenerator::Simple
31+
# :simple : enable client-side timestamps and use a Cassandra::TimestampGenerator::Simple generator.
32+
# :monotonic : enable client-side timestamps and use a Cassandra::TimestampGenerator::TickingOnDuplicate generator.
33+
34+
cluster = Cassandra.cluster(client_timestamps: :simple)
2735
session = cluster.connect("simplex")
2836
2937
# Insert in the present

features/basics/schema_metadata.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Feature: Schema Metadata
7171
Clustering order: asc
7272
Num columns: 4
7373
74-
CREATE TABLE simplex.users (
74+
CREATE TABLE simplex."users" (
7575
user_id bigint,
7676
last text,
7777
age int,

0 commit comments

Comments
 (0)