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
Upgrade cql-io #495
Merged
Merged
Upgrade cql-io #495
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eagerRetryHandlers in all the places where x5 is currently used seems safe, since lightweight transactions, counters and operations on lists are not in use in any of the x5 retry statements. The only query which 'looks' unsafe is https://github.com/wireapp/wire-server/blob/develop/services/brig/src/Brig/Unique.hs#L56, however it operates on sets, not on lists; so it is safe to use eagerRetry here.
jschaul
force-pushed
the
new-cassandra
branch
from
October 23, 2018 15:10
55f2cf3
to
80a9b13
Compare
tiago-loureiro
approved these changes
Oct 23, 2018
RsResult _ (SetKeyspaceResult _) -> return () | ||
RsError _ e -> throwM e | ||
_ -> throwM (UnexpectedResponse' r) | ||
useKeyspace (Keyspace k) = void . getResult =<< qry |
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.
Didn't have a look at the internal changes in cql-io, is it OK to just ignore the result of qry
?
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.
getResult
will throw an error, if any:
-- | Get the 'Result' out of a 'HostResponse'. If the response is an 'RsError',
-- a 'ResponseError' is thrown. If the response is neither
-- 'RsResult' nor 'RsError', an 'UnexpectedResponse' is thrown.
getResult :: MonadThrow m => HostResponse k a b -> m (Result k a b)
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Upgrade to the lastest
cql-io
. There are multiple reasons for upgrading, see the changelog.One reason is to try out the changes from this MR relating to the problem described here. To this end,
initialContactsDNS
is no longer used, so that cql-io can re-resolve the DNS upon losing a control connection. (I tried this out locally by adding an entry to/etc/hosts
, connecting via DNS, then changing the bind IP of the underlying cassandra - this works as advertised.)One change done was to map the existing usage of
x1
todefaultRetrySettings
andx5
toeagerRetrySettings
. As commented onx5
, it is only safe to use this on idempotent queries. Upon inspection of our current queries using x5, it appears all of these queries are idempotent.Side-effects:
MonadBaseControl
andControl.Concurrent.*
toUnliftIO.*
everywhere (thanks @neongreen).