[#596] Initial implementation of SCYLLA_USE_METADATA_ID protocol feature negotiation#663
Merged
dkropachev merged 2 commits intoscylladb:scylla-3.xfrom Oct 14, 2025
Merged
Conversation
dkropachev
reviewed
Sep 25, 2025
| /** | ||
| * Gets invoked when the listener is registered with a cluster, or at cluster startup if the | ||
| * listener was registered at initialization with {@link | ||
| * com.datastax.driver.core.Cluster#register(Host.StateListener)}. |
There was a problem hiding this comment.
Please move these kind of changes into a separate commit with proper message to it that explains why it is done
Author
There was a problem hiding this comment.
This should've been some automated change, but what tool has performed it. I will revert the changes
There was a problem hiding this comment.
I still see them, please remove them from the PR.
55b46e4 to
559cd95
Compare
dkropachev
reviewed
Oct 3, 2025
driver-core/src/main/java/com/datastax/driver/core/Connection.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/java/com/datastax/driver/core/Message.java
Outdated
Show resolved
Hide resolved
nikagra
commented
Oct 8, 2025
driver-core/src/main/java/com/datastax/driver/core/SessionManager.java
Outdated
Show resolved
Hide resolved
1349c00 to
2cbb7bf
Compare
dkropachev
reviewed
Oct 10, 2025
driver-core/src/main/java/com/datastax/driver/core/ProtocolFeatureStore.java
Outdated
Show resolved
Hide resolved
driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java
Outdated
Show resolved
Hide resolved
driver-core/src/test/java/com/datastax/driver/core/PreparedStatementInvalidationTest.java
Outdated
Show resolved
Hide resolved
e2971d2 to
82e78f0
Compare
3daac00 to
ff4451f
Compare
nikagra
commented
Oct 13, 2025
0d9e088 to
3b34d0c
Compare
dkropachev
requested changes
Oct 14, 2025
| /** | ||
| * Gets invoked when the listener is registered with a cluster, or at cluster startup if the | ||
| * listener was registered at initialization with {@link | ||
| * com.datastax.driver.core.Cluster#register(Host.StateListener)}. |
There was a problem hiding this comment.
I still see them, please remove them from the PR.
driver-core/src/main/java/com/datastax/driver/core/Message.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/java/com/datastax/driver/core/Message.java
Outdated
Show resolved
Hide resolved
70b2368 to
ca5672c
Compare
SCYLLA_USE_METADATA_ID protocol fe…SCYLLA_USE_METADATA_ID protocol feature negotiation
30edf34 to
9334677
Compare
288d8bc to
c1d0287
Compare
dkropachev
approved these changes
Oct 14, 2025
…ature negotiation. Introducing `ProtocolFeatureStore`. [scylladb#596] Initial implementation of SCYLLA_USE_METADATA_ID feature. [scylladb#596] Fixing NPE when accessing sharding info from empty ProtocolFeatureStore. [scylladb#596] Storing `ProtocolFeatureStore` in `ProtocolEncoder`/`ProtocolDecoder`. Getting read of sharing it via `Channel` attributes. [scylladb#596] Addressing missing `ProtocolFeatureStore` in a `statement` param of `executeAsync` to fix ITs. [scylladb#596] Adjusting the way feature store is handled in `DefaultResultSetFuture`. Removing feature store from its constructor. [scylladb#596] Moving channel attribute management for feature store to utility methods of `ProtocolFeatureStore`. [scylladb#596] Setting `Host`'s feature store separately from `Channel`. Code clean up Apply suggestion from @dkropachev Co-authored-by: Dmitry Kropachev <[email protected]> [scylladb#596] `ProtocolEncoder` clean up.
…validationTest`. Registering for closure resources implementing `AutoCloseable` interface in flaky tests class. [scylladb#596] Improving Scylla test coverage in `PreparedStatementInvalidationTest`. Apply suggestion from @dkropachev Rearranging assertions and minor improvements in `should_never_update_statement_id_for_conditional_updates` Co-authored-by: Dmitry Kropachev <[email protected]>
c1d0287 to
76a5354
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue java-driver#596
repared statements invalidation used to be completely broken, you can read details on it here
Recently core merged PR that fixes problems for select statements.
After that PR, if driver supply
SCYLLA_USE_METADATA_IDat the startup, when statements is prepared server hands out result queries metadata hash.When driver executes this query it sends metadata id alongside with the request.
Server checks driver metadata id and what it has on its side, if there is any difference it will send new metadata and metadata id.
Driver suppose to pick it up and update metadata and metadata id on it's side, before deserializing response, solving issue with having outdated metadata on driver side.
Unfortunately it is solved only for SELECT statements, UPDATE/INSERT will be solved on separate occasion.
Core changes are in, we need to start working on driver side.
To Be Done:
SCYLLA_USE_METADATA_IDprotocol extension from SUPPORTED frame;METADATA_CHANGED(=3) flag in result metadata;Resolve skip metadata flag
Default value of skip metadata flag should be treated as
safest optionWhich means that if
SCYLLA_USE_METADATA_IDwas negotiated or CQL v5 is used then it is true, result metadata is skipped.In other cases it is false.
Changes
SCYLLA_USE_METADATA_IDextension during protocol initializationOptionsstep.ProtocolFeatureenum toProtocolFeaturesclass enhancingisSUpportedBymethod.ProtocolFeatureStoreinstance, which stores information about optional protocol features.Messageto loadProtocolFeatureStorefrom channel and to later use it for encoding and decoding (in encoders and decoders).