[#527] Implement SCYLLA_USE_METADATA_ID protocol extention negotiat…
#590
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.
…ion.
Issue gocql#527
Prepared 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
scyllaUseMetadataIdExtascqlProtocolExtensioninterface (ensures protocol extension negotiation)framerto havescyllaUseMetadataIdflag set if the extension was negotiatedscyllaUseMetadataIdflag to:resultMetadataIDduring writing of EXECUTE frame andresultMetadataIDduring parsing of RESULT (prepared) frame