Skip to content

(Improvement) Remove CQL binary protocol v3 - #686

Draft
mykaul wants to merge 1 commit into
scylladb:masterfrom
mykaul:remove_proto_v3_clean
Draft

(Improvement) Remove CQL binary protocol v3#686
mykaul wants to merge 1 commit into
scylladb:masterfrom
mykaul:remove_proto_v3_clean

Conversation

@mykaul

Copy link
Copy Markdown

No one needs it anymore. Any reasonable version of Cassandra and ScyllaDB support CQL binary protocol v4 (or higher).

This also assume that we test against Cassandra 2.2 or above, so removed some <= 2.1 items.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

@mykaul
mykaul marked this pull request as draft February 2, 2026 21:56
@mykaul
mykaulforce-pushed the remove_proto_v3_clean branch from 59ebff4 to 3694533CompareFebruary 3, 2026 11:54
@mykaul

Copy link
Copy Markdown
Author

I'm very proud of:

+472 −1,193 

@Lorak-mmk

Copy link
Copy Markdown

@mykaul Could you please discuss next steps for that with @roydahan ?
On last team call we raised the idea to remove protocol v3, first from matrix, then from driver and scylla.
Roy's concern is that it should be done with a proper depreciation announcements, making sure then no one uses it etc.

@mykaul

Copy link
Copy Markdown
Author

@mykaul Could you please discuss next steps for that with @roydahan ? On last team call we raised the idea to remove protocol v3, first from matrix, then from driver and scylla. Roy's concern is that it should be done with a proper depreciation announcements, making sure then no one uses it etc.

In theory, you are right. In practice - Scylla uses and supports v4, who is going to use v3 against it? and if they do, why would they upgrade their driver? but generally - fair point - we need to deprecate it in docs or something first. I'll get it to 2026.1 hopefully.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request removes support for CQL binary protocol v3, establishing v4 as the minimum supported protocol version. This change assumes that all reasonable versions of Cassandra (2.2+) and ScyllaDB support protocol v4 or higher.

Changes:

  • Removed protocol version 3 constant and updated SUPPORTED_VERSIONS tuple to (V5, V4)
  • Removed protocol_version parameter from all serialize() and deserialize() methods across the codebase
  • Removed deprecated credentials-based authentication (protocol v1 only) in favor of SASL-based authentication
  • Updated tests to remove protocol v3-specific test cases and version checks
  • Updated documentation examples to use protocol_version=4 instead of protocol_version=3

Reviewed changes

Copilot reviewed 71 out of 71 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
cassandra/init.pyRemoved V3 constant and updated SUPPORTED_VERSIONS tuple
cassandra/protocol.pyRemoved CredentialsMessage class and updated message handling to remove protocol_version checks
cassandra/query.pyRemoved protocol_version from PreparedStatement and BoundStatement parameter handling
cassandra/cqltypes.pyRemoved protocol_version parameter from serialize/deserialize methods and removed internal version checks
cassandra/cluster.pyUpdated auth_provider validation and user type registration to remove protocol version checks
cassandra/connection.pyRemoved credentials-based authentication flow, keeping only SASL authentication
cassandra/util.pyRemoved protocol_version from OrderedMapSerializedKey constructor and methods
cassandra/.pyx/.pxdRemoved protocol_version from Cython deserializers and parsers
tests/unit/*.pyUpdated unit tests to remove protocol v3-specific test cases and protocol_version parameters
tests/integration/*.pyRemoved version checks for Cassandra < 2.2 and updated helper functions to return v4 as minimum
docs/*.rstUpdated documentation examples to use protocol_version=4
CONTRIBUTING.rstUpdated protocol version defaults documentation
Comments suppressed due to low confidence (1)

tests/integration/standard/test_metadata.py:48

  • Import of 'get_supported_protocol_versions' is not used.
    Import of 'greaterthanorequalcass40' is not used.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadtests/integration/__init__.py
@mykaul
mykaulforce-pushed the remove_proto_v3_clean branch from 3694533 to 32d5e69CompareFebruary 6, 2026 08:43
@mykaul

Copy link
Copy Markdown
Author

Very odd that some additional unit tests failed (on my laptop) and not on CI :-/

@mykaul

Copy link
Copy Markdown
Author

test_idle_heartbeat failure doesn't look related... Investigating.

No one needs it anymore. Any reasonable version of Cassandra and ScyllaDB support
CQL binary protocol v4 (or higher).
This also assume that we test against Cassandra 2.2 or above, so removed some <= 2.1 items.
Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>
CopilotAI review requested due to automatic review settings July 29, 2026 17:52
@mykaul
mykaulforce-pushed the remove_proto_v3_clean branch from 32d5e69 to 4856d8cCompareJuly 29, 2026 17:52
@coderabbitai

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 83d5f136-a9c1-4353-9ed2-04c6f647d0ca

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@mykaul

Copy link
Copy Markdown
Author

Rebased onto current master (this branch was ~120 commits stale) and fixed the resulting fallout so CI can actually run:

  • Resolved merge conflicts across cassandra/{cluster,cqltypes,protocol,query}.py, cassandra/deserializers.pyx, and ~15 integration test files. In each case kept master's newer logic (e.g. the ms-precision DateType/DesDateType fix for Large values of CQL type timestamp lose precision due to some floating-point conversions along the way #532, the cached tablet-routing CassType, the _result_metadata_and_id tuple design from the SCYLLA_USE_METADATA_ID work, NetworkTopologyStrategy/wait_for_all_pools test fixes) while applying this PR's removal of the now-dead protocol_version parameter/v1-v2-v3 gating.
  • Removed TypeTestsProtocol.test_nested_types_with_protocol_version (tested nested-type (de)serialization across protocol v3 vs v4 — moot once v3 is gone and serialization no longer varies by protocol version) and the notprotocolv1/greaterthancass2x/lessthancass30/USE_CASS_EXTERNAL references that no longer exist post-rebase.
  • Fixed real breakage the rebase surfaced in tests/unit/test_query.py, tests/unit/test_response_future.py, and tests/unit/test_types.py: stray protocol_version=4 kwargs to PreparedStatement(...) (no longer an accepted parameter) and a stray extra positional arg to DateType.deserialize/serialize in the Large values of CQL type timestamp lose precision due to some floating-point conversions along the way #532 precision-loss test added after this branch forked.
  • Built the Cython extensions and confirmed deserializers.pyx/.pxd compile and import cleanly (HAVE_CYTHON=True), and ran the full tests/unit/ suite (770 passed, 38 skipped, 0 failed) plus a collect-only pass over tests/integration/standard and tests/integration/cqlengine (1018 tests collected, no import/NameError issues) to validate the many decorator/import fixups.

Not redundant with master's f3e0c6242 ("remove support for protocols <3 from cython files") — that commit only dropped v1/v2 support from the Cython path; this PR goes further and removes the now-vestigial protocol_version parameter/v3 support entirely across both the pure-Python and Cython (de)serialization paths.

Kept as draft per the open discussion above about coordinating a deprecation announcement before merging.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 68 out of 68 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (4)

tests/unit/test_parameter_binding.py:199

  • These empty protocol subclasses now inherit exactly the same setup and tests, so unittest/pytest collects and executes the entire binding suite three times with no version-specific coverage. Since the protocol field and overrides were removed, collapse this to a single test class (and rename the remaining V3 class) instead of retaining duplicate V4/V5 subclasses.
    cassandra/init.py:168
  • This changes the driver's minimum supported native protocol (and therefore minimum Cassandra version) but the Unreleased changelog has no entry for it. The same changelog already calls out contracted signature changes (CHANGELOG.rst:12-24); please add a compatibility note covering the v4 minimum and the removed serialization/custom-handler arguments so users can assess the upgrade impact.
 SUPPORTED_VERSIONS = (V5, V4)
"""
A tuple of all supported protocol versions for ScyllaDB.

cassandra/cqltypes.py:328

  • Removing the protocol argument here leaves AES256ColumnEncryptionPolicy.encode_and_encrypt() calling the old signature as coldata.type.serialize(obj, None) (cassandra/column_encryption/_policies.py:117). Every use of that helper now raises TypeError before encryption; update the caller and its coverage, or retain a backward-compatible ignored argument.
 def serialize(val):

cassandra/cqltypes.py:318

  • The Cassandra 2.2 aggregate metadata parser still calls cass_state_type.deserialize(initial_condition, 3) in cassandra/metadata.py:2208. With this one-argument signature, reading metadata for an aggregate with an initial condition raises TypeError; update that parser call (and its test) or keep an ignored compatibility argument.
 def deserialize(byts):

Sign up for freeto 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.

3 participants

@mykaul@Lorak-mmk