Skip to content
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

Merged

Commits on Sep 19, 2024

  1. retry_policy: adjust retry decision to new error variants

    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.
    muzarski committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    efbb1ec View commit details
    Browse the repository at this point in the history
  2. use_keyspace: deduplicate the code shared by conn_pool and cluster

    Extracted the logic of retrieving use_keyspace result to
    utility function.
    muzarski committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    cce3e6b View commit details
    Browse the repository at this point in the history
  3. use_keyspace: adjust the result of operation to broken connection errors

    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.
    muzarski committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    4b12896 View commit details
    Browse the repository at this point in the history
  4. spec_execution: adjust can_be_ignored to broken connection errors

    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).
    muzarski committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    9ae0077 View commit details
    Browse the repository at this point in the history
  5. errors: remove IoError variant from [Query/NS]Error

    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).
    muzarski committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    ce0fdca View commit details
    Browse the repository at this point in the history