Released on: 2018/11/09
- Support for binary CQL frames with custom payload. #119
- Favor the
rpc_address
value to connect to the provided contact points. #122
Released on: 2018/08/10
- Environments with DNS load-balancing in effect for
contact_points
provided as hostnames (e.g. Kubernetes withcontact_points = { "cassandra" }
) could result inno host details for <peer IP>
errors when using multiple instances of the Cluster module. This is now fixed. #118
1.3.1 - 2018/07/02
- The new request-aware load-balancing policies can now be used in the init_by_lua* context when using the lua-resty-core module (only applies to OpenResty environments). #117
1.3.0 - 2018/06/14
- New request-aware load-balancing policy for OpenResty environments.
- New request-aware + datacenter-aware load-balancing policy for OpenResty environments. Thanks @kikito for the patch! #114
1.2.3 - 2017/07/20
- Expose the
check_schema_consensus()
method of the Cluster module for host applications to use.
- Safely share peers across workers in the Cluster module. #97
1.2.2 - 2017/05/17
- New
cafile
option for the Cluster module. This allows supporting SSL connections to Cassandra clusters when lua-cassandra is used in contexts that do not support cosockets, and fallback on LuaSocket. #95
1.2.1 - 2017/04/03
- Force the Nginx time to be updated when checking for schema consensus timeout. #90
1.2.0 - 2017/03/24
- Methods to manually add and remove peers from a Cluster module instance. #87
1.1.1 - 2016/02/28
- Expose the underlying
first_coordinator
andwait_schema_consensus
functions from the Cluster module.
1.1.0 - 2016/01/12
⚠️ Peers are now part of different connection pools depending on their keyspace. This can fix eventual issues when using several keyspaces with a single peer/cluster instance. 6c0db5e This is a breaking change:-- before: local peer = cassandra.new() peer:connect() peer:set_keyspace('my_keyspace') -- after: local peer = cassandra.new() peer:connect() peer:change_keyspace('my_keyspace') -- closes the underlying connection and open a new one
- New
coordinator_options
forexecute()
/batch()
/iterate()
allowing for more granularity in keyspace settings. Accepted options arekeyspace
andno_keyspace
. Example:local Cluster = cluster.new { keyspace = 'my_keyspace' } local res = cluster:execute('SELECT * FROM local', nil, { keyspace = 'system' -- will spawn or reuse a peer with 'system' keyspace --no_keyspace = true -- would disable setting a keyspace for this request })
- Support for binary protocol v4.
#61
- New
cassandra.null
CQL marshalling type. This type is different thancassandra.unset
for protocol v4 and will set to null existing columns (in protocol v4 usage only). - Parse
SCHEMA_CHANGE
results forFUNCTION
andAGGREGATE
. - The Cluster module now parses warnings contained in response frames and
logs them at the
ngx.WARN
level.
- New
- Implement a
silent
option forCluster.new()
to disable logging in the nginx error logs. #60 - Implement a
lock_timeout
option forCluster.new()
to specify a max waiting time in seconds for the cluster refreshing and requests preparing mutexes. This option prevents such mutexes to hang for too long. 2bd3d66 - The
cluster:refresh()
method now returns the list of fetched Cassandra nodes from the cluster as a third return value. 34f5f11
- Correctly logs the address of peers being set UP or DOWN in the warning logs. 40fd870
- Better error messages for SSL handshake/locking failures.
- Better handling in case the shm containing the cluster info is full. We do
not override previous values at the risk of losing cluster nodes info, but
error out with the
"no memory"
error instead. 4520a3b - Correctly receives read and connect timeout options. #71
- Log the reason behind retrying a request in the
cluster
module. #71 - Fallback on
listen_address
whenrpc_address
is "bind all" when refreshing the cluster nodes with thecluster
module. #72 - Propagate the CQL version in use when marshalling CQL collection types such as map, set, tuple or udt. We now properly marshall such nested CQL values. #73
1.0.0 - 2016/07/27
- New single host
cassandra
module, able to connect to a single Cassandra node. - New cluster
resty.cassandra.cluster
module, which leverages the single host module and is able to efficiently deal with a multi-nodes Cassandra cluster. - No more tables as errors. All errors returned by those modules are now strings.
- Some considerable performance improvements compared to the previous versions: according to the benchmarks I ran while writing this new implementation (on a late 2013 Macbook Pro), this new version allows up to 10k q/sec compared to 2k q/s with its old version. I plan on making those benchmarks available publicly in the near future.
- Support for named arguments when binding query parameters (binary protocol v3).
- Support for client-side timestamps (binary protocol v3).
- Support for query tracing.
- New "datacenter-aware round robin" load balancing policy. This policy will prioritize nodes from the local datacenter in multi-DC setups.
- A much more complete and reliable test suite (yay!).
- A more complete documentation, including the available policies and better usage examples.
0.5.1 - 2016/04/11
- Use the
default_port
option when connecting to peers instead of the CQL default (9042
). #49
0.5.0 - 2016/02/02
-
Following Datastax's model and allowing better flexibility with various C* providers, authentication now happens with an AuthProvider table that must be instanciated and passed to a session's options. Example:
local session, err = cassandra.spawn_session { shm = "...", contact_points = {...}, username = "username", password = "password" }
Becomes:
local session, err = cassandra.spawn_session { shm = "...", contact_points = {...}, auth = cassandra.auth.PlainTextProvider("username", "password") }
The
cassandra
module contains AuthProviders incassandra.auth
. OnlyPlainTextProvider
is currently implemented. -
Remove the
set_log_lvl()
function from thecassandra
module.
- Stronger test suite and new specs for SSL and Authentication.
0.4.2 - 2016/01/16
- Correct timeout check for schema consensus. Prior to this, schema consensus systematically timed out after 0.5s. #24
- More documentation.
- Stronger test suite and CI.
0.4.1 - 2015/12/18
- Compatibility for C* < 2.1.6. The query to retrieve the local node's details
does not rely on the existance of an
rpc_address
field anymore, since that field was only added in 2.1.6. See https://issues.apache.org/jira/browse/CASSANDRA-9436.
0.4.0 - 2015/12/17
Complete rewrite of the driver, to the exception of the serializers.
This release is a complete breaking change with previous versions of the driver. #15
- Cluster topology auto detection.
contact_points
are not used as the only available nodes anymore but as entry point to discover the cluster's topology. - Cluster awareness capabilities. The driver is now capable of keeping track of which nodes are healthy or unhealthy.
- Load balancing, reconnection, retry and address resolution policies. Only
one of each is currently implemented.
- Load balancing: shared round-robin accross all workers. Used to load-balance the queries in the cluster.
- Reconnection: shared exponential (exponential reconnection time shared accross all workers). Used to determine when an unhealthy node should be retried.
- Retry: a basic retry policy. Used to determine which queries to retry or throw errors.
- Address resolution: a basic address resolution policy. Used to resolve
rpc_address
fields.
- Waiting for schema consensus between nodes on
SCHEMA_CHANGE
(DML queries). - Many more options, configurable per session/query (queries can be executed with options overriding the session's option).
- Complete abstraction of prepared queries. A simple option to
execute()
will handle the query preparation. If a node throws anUNPREPARED
error, the query will be prepared and retried seamlessly. - Stronger test suite. Unit/integration tests with Busted, and ngx_lua integration tests with Test::Nginx Perl module. Travis-CI jobs are also faster and more reliable, and run all test suites.
- Binary protocol auto-detection: downgrade from 3 to 2 automatically when using C* 2.0.
- Compatible with Lua 5.1, 5.2, 5.3, LuaJIT.
- Overall, a better architecture for a better maintainability.
- Still optimized for ngx_lua (cosocket API) and plain Lua (with LuaSocket).
- TLS client-to-node encryption and Authentication (PasswordAuthenticator) are still supported.
- The serializers stayed the same (even if their architecture was rewritten).
- No more support for query tracing (will be added back later).
0.3.6 - 2015/08/06
- Better error handling in case of CA certificate error with Luasocket.
- Port number in addition to host in socket errors.
- Shuffling of contact points array.
0.3.5 - 2015/07/15
- Expose consistency and batch types constants in
cassandra
. - Better SSL handshake error handling.
0.3.3 - 2015/07/14
- Binary protocol v3 accidentally used v2 encoding methods.
- Startup message accidentally being sent for already established connections (with reusable sockets).
0.3.0 - 2015/07/07
- Support for SSL encryption (client/server).
- IPv6 addresses encoding.
0.2.0 - 2015/07/07
- Support for authentication (Password Authenticator).
Initial release. Forked from jbochi/lua-resty-cassandra v0.5.7 with some additional features and bug fixes.
- Support for both binary protocols v2 and v3.
- More friendly support of auto pagination. THe loop doesn't require as many parameters.
- OOP style in order to support both binary protocols.
cassandra.new()
must now be called with:
.
set_keyspace
erroring on names with capital letters.