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

Upgrade cql-io #495

Merged
merged 11 commits into from Oct 23, 2018
Merged

Upgrade cql-io #495

merged 11 commits into from Oct 23, 2018

Conversation

jschaul
Copy link
Member

@jschaul jschaul commented Oct 17, 2018

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 to defaultRetrySettings and x5 to eagerRetrySettings. As commented on x5, 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:

  • switch from MonadBaseControl and Control.Concurrent.* to UnliftIO.* everywhere (thanks @neongreen).

@jschaul jschaul changed the title [WIP] New cassandra Upgrade cql-io Oct 23, 2018
RsResult _ (SetKeyspaceResult _) -> return ()
RsError _ e -> throwM e
_ -> throwM (UnexpectedResponse' r)
useKeyspace (Keyspace k) = void . getResult =<< qry
Copy link
Contributor

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?

Copy link
Member Author

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)

@jschaul jschaul merged commit 3d0645c into develop Oct 23, 2018
@jschaul jschaul deleted the new-cassandra branch October 23, 2018 16:25
@fisx fisx mentioned this pull request Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants