-
Notifications
You must be signed in to change notification settings - Fork 104
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
Fix RoutingInfo consistency #743
Fix RoutingInfo consistency #743
Commits on Jul 27, 2023
-
scylla_cql: Impl TryFrom<u8> for BatchType
This will be used in proxy, to inspect request frames from the driver.
Configuration menu - View commit details
-
Copy full SHA for fde10bb - Browse repository at this point
Copy the full SHA fde10bbView commit details -
value: fix statements-value count mismatch message
The generated error contained wrong value list count: it failed to include the number of value lists that were already paired with statements. As a bonus, a cleaner `count()` implementation was added to `BatchValuesIterator` trait, instead of using a dirty workaround.
Configuration menu - View commit details
-
Copy full SHA for a7ac062 - Browse repository at this point
Copy the full SHA a7ac062View commit details -
scylla_cql: get rid of iterator in Batch
The iterator is not an accurate choice: the Batch struct does not contain any iteration state, so a plain slice would be a better choice.
Configuration menu - View commit details
-
Copy full SHA for 8b35084 - Browse repository at this point
Copy the full SHA 8b35084View commit details -
scylla_cql: Cow gives requests flexible ownership
Before, only borrowed requests were allowed (for instance, Query contained the borrowed query contents as &str). For convenient deserialization and for test purposes, owned requests are preferred, so the definitions are made contain `Cow`s.
Configuration menu - View commit details
-
Copy full SHA for 04ba776 - Browse repository at this point
Copy the full SHA 04ba776View commit details -
scylla_cql: derive test Debug for some requests
This will be used in some tests.
Configuration menu - View commit details
-
Copy full SHA for 58ea66e - Browse repository at this point
Copy the full SHA 58ea66eView commit details -
scylla_cql: derive test Eq for some types
This is required for tests.
Configuration menu - View commit details
-
Copy full SHA for 234b2ca - Browse repository at this point
Copy the full SHA 234b2caView commit details -
scylla_cql: add deser capabilities for requests
Introduces DeserializableRequest trait whose main goal is testing purposes.
Configuration menu - View commit details
-
Copy full SHA for c3c2270 - Browse repository at this point
Copy the full SHA c3c2270View commit details -
scylla_cql: add tests for request deserialization
One simply asserts that serialization composed with deserialization is identity. Another makes sure that unknown flags lead to frame rejection (as deserializing frame containing unknown flags will likely lead to misinterpretation of some unknown protocol extensions).
Configuration menu - View commit details
-
Copy full SHA for ac9166f - Browse repository at this point
Copy the full SHA ac9166fView commit details -
scylla_cql: rename Request to SerializableRequest
The mentioned trait essentially serves the purpose of serialization, so the change is justified. The name `Request` will be used for an umbrella enum containing various types of requests.
Configuration menu - View commit details
-
Copy full SHA for 92800d4 - Browse repository at this point
Copy the full SHA 92800d4View commit details -
scylla_cql: introduce Request umbrella enum
This enum provided unified interface over CQL requests, useful for testing. Now, it supports only Query, Execute and Batch (it panics if attempted to deserialize a different opcode) and provided getters for Consistency and SerialConsistency. In the future, it can be extended for further test checks.
Configuration menu - View commit details
-
Copy full SHA for eb935d8 - Browse repository at this point
Copy the full SHA eb935d8View commit details -
integration: add tests for [serial] consistency
One test checks for each [serial] possible consistency that the request frame indeed contains the specified [serial] consistency. Another test checks that RoutingInfo's consistencies match the specified ones. As the latter test confirmed the bug in Session regarding RoutingInfo, it is temporarily marked as ignored. The mark will be removed in the next commit, after the bug is fixed.
Configuration menu - View commit details
-
Copy full SHA for 7bc2af7 - Browse repository at this point
Copy the full SHA 7bc2af7View commit details -
session: fix: set correct consistency in RoutingInfo
The test added in the previous commit proves that the routing info has wrong Consistency and SerialConsistency set. Therefore, Session::query_paged(), execute_paged() and batch() are all fixed to respect correct consistencies. The test's "ignore" mark is henceforth removed.
Configuration menu - View commit details
-
Copy full SHA for 8120294 - Browse repository at this point
Copy the full SHA 8120294View commit details -
session: pass exec profile to Session::run_query()
As access to the execution profile is anyway needed in the callers of `Session::run_query()` (in order to put correct Consistency and SerialConsistency into RoutingInfo), the acquired Arc<ExecutionProfileInner> is passed to `Session::run_query()` as another argument. This prevents duplication of Arc cloning.
Configuration menu - View commit details
-
Copy full SHA for f97b7b2 - Browse repository at this point
Copy the full SHA f97b7b2View commit details -
session: ExecuteQueryContext::consistency -> ...set_on_statement
There are three levels of consistency that are taken into account by the Session: default exec profile's, per-statement exec profile's and per-statement one. To avoid confusion, we should use naming that clearly distinguishes them. Therefore, ExecuteQueryContext's field is renamed from the vague `consistency` to `consistency_set_on_statement` (the one directly set), as it is exactly its semantics.
Configuration menu - View commit details
-
Copy full SHA for ed5d2bb - Browse repository at this point
Copy the full SHA ed5d2bbView commit details -
iterator: fix: set correct consistency in RoutingInfo
Apparently, routing info had wrong Consistency and SerialConsistency set in iterator, too.
Configuration menu - View commit details
-
Copy full SHA for b1664a7 - Browse repository at this point
Copy the full SHA b1664a7View commit details