-
Notifications
You must be signed in to change notification settings - Fork 108
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
errors: fix driver's logic that bases on error variants returned from query execution #1075
errors: fix driver's logic that bases on error variants returned from query execution #1075
Conversation
See the following report for details: cargo semver-checks output
|
QueryError::IoError is replaced by two new variants which provide more context - them being `BrokenConnection` and `ConnectionPoolError`. In a later commit, we will remove IoError variant (since it is not constructed anywhere). We need to adjust the retry decision - we want to retry execution on some other node in case one of these two error types appeared.
The problems you mentioned sound like serious bugs. Are they present in 0.14 or only on main? |
From what I see, they are directly caused by PRs merged in recent days. |
It was merged yesterday: #1067, so only |
472c32b
to
3172040
Compare
v1.1: Deduplicated the logic shared between |
Extracted the logic of retrieving use_keyspace result to utility function.
The QueryError::IoErrors are no longer created. They now correspond to either QueryError::ConnectionPoolError or QueryError::BrokenConnection. We need to adjust the use_keyspace logic so it does not fail the operation if any of these error variants is returned.
The decision whether an error can be ignored in the context of speculative execution needs to be adjusted as well. We should ignore broken connection errors (previously IoErrors).
As I mentioned previously, these variants were replaced by `BrokenConnection` and `ConnectionPoolError` variants. We can now get rid of the variants that are never constructed. We also need to remove all usages of these variants (retry_policy/use_keyspace/speculative_execution).
3172040
to
ce0fdca
Compare
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants in retry policy modules.
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants when deciding if error received after `USE KEYSPACE` should be ignored.
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants when deciding if error received from speculative execution should be ignored.
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants in `reliable_latency_measure` function. We also enable the `wildcard_enum_match_arm` clippy lint here.
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants in retry policy modules. We also enable `wildcard_enum_match_arm` clippy lint in this place for QueryError and DbError matches.
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants when deciding if error received after `USE KEYSPACE` should be ignored. We also enable the `wildcard_enum_match_arm` clippy lint to disallow using `_` matches.
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants when deciding if error received from speculative execution should be ignored. We also enabled the `wildcard_enum_match_arm` clippy lint.
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants in `reliable_latency_measure` function. We also enable the `wildcard_enum_match_arm` clippy lint here.
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants in retry policy modules. We also enable `wildcard_enum_match_arm` clippy lint in this place for QueryError and DbError matches.
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants when deciding if error received after `USE KEYSPACE` should be ignored. We also enable the `wildcard_enum_match_arm` clippy lint to disallow using `_` matches.
Since last time, during error refactor I introduced a silent bug to the code (scylladb#1075), I'd like to prevent that from happening in the future. This is why we replace a `_` match with explicit error variants when deciding if error received from speculative execution should be ignored. We also enabled the `wildcard_enum_match_arm` clippy lint.
Ref: #519
Motivation
The error refactor that I'm currently working on, surprisingly changed driver's logic in some cases where the decision is made based on the error returned from query execution. There are three places where driver's logic was silently altered:
During error refactor I changed all places where
QueryError::IoError
was constructed. Now all of these IoErrors are represented asBrokenConnectionError
andConnectionPoolError
types (and their variants). These types represent an error which implies that a corresponding connection/node is broken/unreachable.Changes
[Query/NewSession]Error::IoError
variants altogether. They are no longer constructed anywhere - they were replaced byConnectionPoolError
andBrokenConnection
variants during previous refactors.Pre-review checklist
[ ] I added relevant tests for new features and bug fixes.[ ] I have provided docstrings for the public items that I want to introduce.[ ] I have adjusted the documentation in./docs/source/
.Fixes:
annotations to PR description.