Skip to content

Conversation

@worryg0d
Copy link
Owner

No description provided.

tengu-alt and others added 30 commits March 27, 2025 14:46
hostpool package test was refactored to create HostInfo via exported NewhostInfo() constructor.
NewHostInfo() was exposed.

patch by Oleksandr Luzhniy; reviewed by João Reis, for CASSGO-59
Support marshalling and unmarshalling of vector custom type.

patched by Lukasz Antoniak; reviewed by João Reis, Stanislav Bychkov, Oleksandr Luzhniy, Mykyta Oleksiienko and Bohdan Siryk for CASSGO-11
…Batch type

Session.ExecuteBatch() was deprecated and similar methods(MapExecuteBatchCAS,ExecuteBatchCAS)
were deprecated and moved to Batch type

patch by Oleksandr Luzhniy; reviewed by João Reis, Bohdan Siryk, for CASSGO-57
Patch by Stanislav Bychkov; reviewed by João Reis for CASSGO-23
Fix for the endless query execution when HostSelectionPolicy returns
the same downed host.
Internal HostSelectionPolicy will return the host only once if HostID is set.
Documentation for external policies was added.

patch by Oleksandr Luzhniy; reviewed by João Reis, for CASSGO-50
1. Implement all steps in Makefile
2. Make CICD use Makefile
3. Drop setup-environment step, it is done automatically now
4. Add linting step
1. Switch to use golangci instead of govet
2. Enable all linters in govet, except fieldalingment
3. Run `make fix` to fix all the linting problems
4. Fix awaitSchemaAgreement bug found by linters when error is not
   returned

Patch by dkropachev; reviewed by joao-r-reis for CASSGO-77
Fixes:
* method `readTrace()` cleaned from unnecessary conversion `[]byte`->`UUID`->`[]byte`
* method `readUUID()` deleted because unused

Patch by illia-li; reviewed by ... for CASSGO-...
Fixes:
* splits all `append` operations in one

Patch by illia-li; reviewed by ... for CASSGO-...
You can't find servers that support only proto 1 or 2.
And there is no technical benefits to restrict proto to these versions.
So, we can easily remove code that is taking care of these versions.

Patch by dkropachev; reviewed by joao-r-reis for CASSGO-75
Deadlock could happen when closing the refresh debouncer (i.e. when closing the session).
This would result in either a panic or the goroutine calling session.Close() to hang.

patch by João Reis; reviewed by James Hartig, Kevin Kyyro for CASSGO-41
The new RegisteredTypes struct can be used to register externally-defined
types. You'll need to define your own marshalling and unmarshalling code
as well as a TypeInfo implementation. The name and id MUST not collide
with existing and future native CQL types.

A lot of the type handling was refactored to use the new format for
types.

inet columns are now unmarshaled as net.IP which is a breaking change.

goos: linux
goarch: amd64
pkg: github.com/gocql/gocql
cpu: AMD EPYC 7B13
                             │    old.txt    │                new3.txt                │
                             │    sec/op     │    sec/op     vs base                  │
SingleConn-16                   25.87µ ±  2%   26.49µ ±  1%   +2.40% (p=0.000 n=10)
ParseRowsFrame-16               870.5n ±  3%   683.1n ±  4%  -21.52% (p=0.000 n=10)
UnmarshalVarchar-16             47.29n ±  2%
UnmarshalUUID-16                3.161n ±  2%
Unmarshal_BigInt-16             17.61n ±  9%   13.47n ±  0%  -23.48% (p=0.000 n=10)
Unmarshal_Blob-16               19.19n ±  0%   14.79n ±  2%  -22.88% (p=0.000 n=10)
Unmarshal_Boolean-16            15.71n ±  0%   12.20n ±  1%  -22.32% (p=0.000 n=10)
Unmarshal_Date-16               18.53n ±  1%   15.98n ±  0%  -13.73% (p=0.000 n=10)
Unmarshal_Decimal-16           172.15n ±  2%   96.55n ±  1%  -43.92% (p=0.000 n=10)
Unmarshal_Double-16             16.33n ±  1%   12.21n ±  0%  -25.20% (p=0.000 n=10)
Unmarshal_Duration-16           26.03n ±  1%   22.30n ±  1%  -14.33% (p=0.000 n=10)
Unmarshal_Float-16              15.70n ±  0%   12.21n ±  0%  -22.17% (p=0.000 n=10)
Unmarshal_Int-16                17.80n ±  1%   14.43n ±  0%  -18.96% (p=0.000 n=10)
Unmarshal_Inet-16               28.68n ±  1%   25.25n ±  1%  -11.96% (p=0.000 n=10)
Unmarshal_SmallInt-16           17.92n ±  1%   14.45n ±  1%  -19.37% (p=0.000 n=10)
Unmarshal_Time-16               16.00n ±  1%   12.25n ±  3%  -23.47% (p=0.000 n=10)
Unmarshal_Timestamp-16          16.00n ±  2%   12.23n ±  0%  -23.62% (p=0.000 n=10)
Unmarshal_TinyInt-16            16.38n ±  3%   14.40n ±  1%  -12.09% (p=0.000 n=10)
Unmarshal_UUID-16               16.05n ±  1%   12.56n ±  1%  -21.77% (p=0.000 n=10)
Unmarshal_Varchar-16            18.86n ±  1%   14.81n ±  1%  -21.43% (p=0.000 n=10)
Unmarshal_List-16               176.2n ±  4%   172.9n ±  1%   -1.90% (p=0.002 n=10)
Unmarshal_Set-16                177.7n ±  1%   172.9n ±  0%   -2.67% (p=0.000 n=10)
Unmarshal_Map-16                374.0n ±  5%   348.0n ±  2%   -6.94% (p=0.000 n=10)
Unmarshal_TupleStrings-16       387.9n ±  1%   206.1n ±  1%  -46.85% (p=0.000 n=10)
Unmarshal_TupleInterfaces-16    485.4n ±  2%   289.6n ±  3%  -40.34% (p=0.000 n=10)
FramerReadTypeInfo-16           207.8n ±  3%   168.6n ±  5%  -18.89% (p=0.000 n=10)
ConnStress-16                   14.10µ ± 16%   16.05µ ± 19%        ~ (p=0.363 n=10)
ConnRoutingKey-16               275.3n ±  4%   276.9n ±  2%        ~ (p=0.869 n=10)
WikiCreateSchema-16             515.9m ±  3%   484.9m ±  3%   -6.02% (p=0.000 n=10)
WikiCreatePages-16              1.534m ±  1%   1.469m ±  1%   -4.21% (p=0.000 n=10)
WikiSelectAllPages-16           1.982m ±  3%   1.900m ±  1%   -4.13% (p=0.000 n=10)
WikiSelectSinglePage-16         1.529m ±  2%   1.472m ±  0%   -3.72% (p=0.000 n=10)
WikiSelectPageCount-16          1.691m ±  2%   1.629m ±  2%   -3.67% (p=0.000 n=10)
FramerReadCol-16                107.7n ±  3%   124.6n ±  1%  +15.79% (p=0.000 n=10)
geomean                         375.5n         391.1n        -15.90%                ¹
¹ benchmark set differs from baseline; geomeans may not be comparable

                             │    old.txt     │                 new3.txt                 │
                             │      B/op      │     B/op      vs base                    │
SingleConn-16                  3.155Ki ± 0%     3.157Ki ± 0%   +0.06% (p=0.000 n=10)
ParseRowsFrame-16               1128.0 ± 0%       872.0 ± 0%  -22.70% (p=0.000 n=10)
UnmarshalVarchar-16              32.00 ± 0%
UnmarshalUUID-16                 0.000 ± 0%
Unmarshal_BigInt-16              0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Blob-16                0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Boolean-16             0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Date-16                0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Decimal-16             96.00 ± 0%       48.00 ± 0%  -50.00% (p=0.000 n=10)
Unmarshal_Double-16              0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Duration-16            0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Float-16               0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Int-16                 0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Inet-16                4.000 ± 0%       4.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_SmallInt-16            0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Time-16                0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Timestamp-16           0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_TinyInt-16             0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_UUID-16                0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Varchar-16             0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_List-16                32.00 ± 0%       32.00 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Set-16                 32.00 ± 0%       32.00 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Map-16                 280.0 ± 0%       280.0 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_TupleStrings-16       158.00 ± 0%       62.00 ± 0%  -60.76% (p=0.000 n=10)
Unmarshal_TupleInterfaces-16    190.00 ± 0%       94.00 ± 0%  -50.53% (p=0.000 n=10)
FramerReadTypeInfo-16           160.00 ± 0%       96.00 ± 0%  -40.00% (p=0.000 n=10)
ConnStress-16                  2.956Ki ± 0%     2.958Ki ± 0%        ~ (p=0.238 n=10)
ConnRoutingKey-16                96.00 ± 0%       96.00 ± 0%        ~ (p=1.000 n=10) ¹
WikiCreateSchema-16            59.90Ki ± 3%     57.90Ki ± 1%   -3.34% (p=0.004 n=10)
WikiCreatePages-16             4.357Ki ± 0%     4.355Ki ± 0%        ~ (p=0.236 n=10)
WikiSelectAllPages-16          38.32Ki ± 0%     38.32Ki ± 0%        ~ (p=0.322 n=10)
WikiSelectSinglePage-16        3.783Ki ± 0%     3.781Ki ± 0%        ~ (p=0.239 n=10)
WikiSelectPageCount-16         3.215Ki ± 0%     3.212Ki ± 0%        ~ (p=0.232 n=10)
FramerReadCol-16                 99.00 ± 0%       67.00 ± 0%  -32.32% (p=0.000 n=10)
geomean                                     ²                 -10.43%                ³ ²
¹ all samples are equal
² summaries must be >0 to compute geomean
³ benchmark set differs from baseline; geomeans may not be comparable

                             │    old.txt    │                new3.txt                │
                             │   allocs/op   │ allocs/op   vs base                    │
SingleConn-16                   37.00 ± 0%     37.00 ± 0%        ~ (p=1.000 n=10) ¹
ParseRowsFrame-16               21.00 ± 0%     13.00 ± 0%  -38.10% (p=0.000 n=10)
UnmarshalVarchar-16             1.000 ± 0%
UnmarshalUUID-16                0.000 ± 0%
Unmarshal_BigInt-16             0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Blob-16               0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Boolean-16            0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Date-16               0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Decimal-16            4.000 ± 0%     3.000 ± 0%  -25.00% (p=0.000 n=10)
Unmarshal_Double-16             0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Duration-16           0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Float-16              0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Int-16                0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Inet-16               1.000 ± 0%     1.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_SmallInt-16           0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Time-16               0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Timestamp-16          0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_TinyInt-16            0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_UUID-16               0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Varchar-16            0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_List-16               2.000 ± 0%     2.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Set-16                2.000 ± 0%     2.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_Map-16                5.000 ± 0%     5.000 ± 0%        ~ (p=1.000 n=10) ¹
Unmarshal_TupleStrings-16       8.000 ± 0%     4.000 ± 0%  -50.00% (p=0.000 n=10)
Unmarshal_TupleInterfaces-16   10.000 ± 0%     6.000 ± 0%  -40.00% (p=0.000 n=10)
FramerReadTypeInfo-16           4.000 ± 0%     4.000 ± 0%        ~ (p=1.000 n=10) ¹
ConnStress-16                   35.00 ± 0%     35.00 ± 0%        ~ (p=1.000 n=10)
ConnRoutingKey-16               4.000 ± 0%     4.000 ± 0%        ~ (p=1.000 n=10) ¹
WikiCreateSchema-16             858.0 ± 3%     746.0 ± 1%  -13.05% (p=0.000 n=10)
WikiCreatePages-16              56.00 ± 2%     56.00 ± 2%        ~ (p=1.000 n=10)
WikiSelectAllPages-16           343.0 ± 0%     343.0 ± 0%        ~ (p=1.000 n=10) ¹
WikiSelectSinglePage-16         50.00 ± 0%     50.00 ± 0%        ~ (p=1.000 n=10) ¹
WikiSelectPageCount-16          45.00 ± 0%     45.00 ± 0%        ~ (p=1.000 n=10) ¹
FramerReadCol-16                3.000 ± 0%     3.000 ± 0%        ~ (p=1.000 n=10) ¹
geomean                                    ²                -6.38%                ³ ²
¹ all samples are equal
² summaries must be >0 to compute geomean
³ benchmark set differs from baseline; geomeans may not be comparable

Patch by James Hartig for CASSGO-43; reviewed by João Reis for CASSGO-43
Before this change queries were mutated while being executed (the query metrics and the consistency for example).
Instead copy query properties to an internal query object and move query metrics to Iter. This allows users
to reuse Query and Batch objects. Query object pooling was also removed.

Some query and batch properties were not accessible via ObservedBatch and ObservedQuery. Added the original Batch and Query
objects to ObservedBatch and ObservedQuery to fix this.

Patch by João Reis; reviewed by James Hartig and Stanislav Bychkov for CASSGO-22 and CASSGO-73
Currently, Snappy is downloaded and included even when users only require LZ4 compression.
To streamline the driver and reduce unnecessary dependency overhead for users who don't utilize Snappy,
move the Snappy compressor into its own separate package.
This will allow users to include only the compression dependencies they need.

Patch by Mykyta Oleksiienko; reviewed by Joao Reis CASSGO-33
The logger interface uses printf semantics and lacks the notion of log levels.
This commit changes (breaking change) the logger interface so printf semantics
are removed in favor of structured logging and adds log levels.

It provides 3 built in log implementations:
  - Default logger - uses log standard library
  - gocqlzap         - uses zap library
  - gocqlzerolog   - uses zerolog library

Users can use these implementations as is or they can implement their own
using these as examples.

Patch by João Reis; reviewed by James Hartig, Bohdan Siryk for CASSGO-9
It is not possible to test implementations of public gocql interfaces such as
HostFilter because it requires creating HostInfo objects (HostInfo has private fields).

With this change, it is now possible to create HostInfo objects from system.local / system.peers rows
using NewTestHostInfoFromRow().

Patch by João Reis; reviewed by James Hartig for CASSGO-71
This fixes apache#1706.

Patch by James Hartig for CASSGO-6; reviewed by João Reis for CASSGO-6
Current version in go.mod is 1.13 but in practice you need 1.19 to compile the project
so the version in go.mod should be changed to reflect this.

There were discussions about bumping this to a version that we test in CI but
users that aren't using the latest go version would be significantly impacted by this
so we decided against it.

Patch by João Reis; reviewed by Stanislav Bychkov, James Hartig for CASSGO-34
In preparation for the 2.0.0 release we need to change the module name to add the v2
suffix and we take this chance to update the module name according to the new repo location
after the ASF donation.

Patch by João Reis; reviewed by James Hartig for CASSGO-70

# Conflicts:
#	CHANGELOG.md
Tinyint unmarshal silently errors and unmarshals tinyint values as 0 in some situations.
This patch also removes other cases of silent errors in decode functions.

Fix issue where reading vectors with SliceMap is not possible.

Patch by João Reis; reviewed by James Hartig for CASSGO-82, CASSGO-83
In CASSGO-22 we deprecated WithContext but we didn't deprecate Context().
IterContext and ExecContext were added as replacements but there are
other execution methods that lack a Context variant.

This patch addresses both of these issues.

Patch by João Reis; reviewed by James Hartig for CASSGO-81
The driver donation resulted in a change of the main branch name but this change wasn't made in the github workflow. This patch fixes that.

Patch by João Reis; reviewed by James Hartig for CASSGO-85
With the ASF donation we no longer have the ability to specify an exact release date due to the voting process. For this reason we will stop including a release date on the changelog.

This patch also makes it clear what changes were released in 2.0.0-rc1 so that users can know what is different between rc1 and GA.

Patch by João Reis; reviewed by Erik Merkle, Jackson Fleming for CASSGO-86
Driver was automatically setting beta flag when using v5 protocol which causes issues when trying to connect to Cassandra
versions that supported beta v5 like 3.11.

Also, this patch makes the protocol version discovery process more resilient. Still not a long term solution since long term
we should make the protocol version negotiation work like in the java driver.

Patch by João Reis; reviewed by Lukasz Antoniak for CASSGO-88
As part of CASSGO-12 which was supposedly just removing deprecated code, the driver now closes connections when a timeout occurs which was unintended. This patch fixes this issue.

patch by João Reis; reviewed by Bohdan Siryk and Lukasz Antoniak for CASSGO-87
Patch by João Reis; reviewed by Bohdan Siryk and James Hartig for CASSGO-90
This patch updates the existing examples and tests according to the 2.0 changes (mostly deprecations) and adds new examples for new features added in 2.0.

Patch by João Reis; reviewed by Bohdan Siryk and Lukasz Antoniak for CASSGO-80
This patch updates the existing API documentation and adds new documentation for types and methods that lack it.

Patch by João Reis; reviewed by Bohdan Siryk for CASSGO-78
This patch updates the existing pkg.go.dev documentation and adds documentation for the new packages.

This patch also updates the README ands adds a new UPGRADE_GUIDE.md with some documentation for users that will be upgrading from 1.x to 2.x.

Patch by João Reis; reviewed by Bohdan Siryk for CASSGO-79
joao-r-reis and others added 5 commits October 10, 2025 19:29
There is an unintended change in 2.0-rc1 causing the driver to prefer system table addresses over the connection address which breaks deployments that rely on this behavior from 1.x.

This patch fixes this and keeps the behavior the same as it was in 1.x. It also fixes an issue where connection address was not being used when a full ring refresh was triggered.

Patch by João Reis; reviewed by James Hartig for CASSGO-91
…ld methods

StatementMetadata can be called on a session to get the bind, result,
and pk information for a given query. Previously this wasn't publicly
exposed but is necessary for some implementations of HostSelectionPolicy
like token-aware. This might also be useful for CI tooling or runtime
analysis of queries and the types of columns.

NewLogField* are methods to to return a LogField with name and a specific
type.

Finally, session init was cleaned up to prevent a HostSelectionPolicy
from causing a panic if it tried to make a query during init. The
interface was documented that queries should not be attempted.

Patch by James Hartig for CASSGO-92; reviewed by João Reis for CASSGO-92
There were multiple issues with the previous RowData method. First, it was returning
invalid values because it called c.Zero() instead of Zero on column. Second, it
would've returned an interface to a pointer to an interface which is frustrating to
work with.

Now it restores the previous v1 behavior and returns pointers to the underlying
types wrapped in an interface.

Added tests to ensure the behavior is as expected.

Patch by James Hartig; reviewed by João Reis for CASSGO-95
…o v5 is being used

Previously, during frame construction, the driver was setting the frame compression flag for each frame if a compressor is set in the ClusterConfig. However, for the Native Protocol 5 version the compression flag is deprecated. While Cassandra 4.0 just ignores this flag, some other third-party applications that rely on v5 proto could experience errors as the body of the frame is not actually compressed.

Now it adds the compression flag only if the compressor is set and proto version < 5.

Patch by Bohdan Siryk; Reviewed by João Reis for CASSGO-98
…am id different than 0

Previously, protocol negotiation didn't work properly when C* was responding with stream id different from 0.

This patch changes the way protocol negotiation works. Instead of parsing a supported protocol version from C* error response, the driver tries to connect with each supported protocol starting from the latest.

Patch by Bohdan Siryk; Reviewed by <> for CASSGO-98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants