-
Notifications
You must be signed in to change notification settings - Fork 39
[#596] Initial implementation of SCYLLA_USE_METADATA_ID
protocol feature negotiation
#663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#596] Initial implementation of SCYLLA_USE_METADATA_ID
protocol feature negotiation
#663
Conversation
/** | ||
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move these kind of changes into a separate commit with proper message to it that explains why it is done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see them, please remove them from the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still see them
55b46e4
to
559cd95
Compare
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
driver-core/src/main/java/com/datastax/driver/core/SessionManager.java
Outdated
Show resolved
Hide resolved
1349c00
to
2cbb7bf
Compare
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
0d9e088
to
3b34d0c
Compare
/** | ||
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
…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
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_ID
at 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_ID
protocol 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 option
Which means that if
SCYLLA_USE_METADATA_ID
was negotiated or CQL v5 is used then it is true, result metadata is skipped.In other cases it is false.
Changes
SCYLLA_USE_METADATA_ID
extension during protocol initializationOptions
step.ProtocolFeature
enum toProtocolFeatures
class enhancingisSUpportedBy
method.ProtocolFeatureStore
instance, which stores information about optional protocol features.Message
to loadProtocolFeatureStore
from channel and to later use it for encoding and decoding (in encoders and decoders).