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 connections with no messages sent during node outage #940
Fix connections with no messages sent during node outage #940
Conversation
16c23a3
to
a42fec1
Compare
Why do we want the user to retry a failed message when the error is internal to shotover? |
An internal shotover error is really just the destination DB did something unexpected, in this case its that the connection was lost. The change in this PR recreates the connection when its lost but we don't retry internally and expect the user to do that for us. But I think you could be onto something. |
I think returning overloaded is not quite right in this situation. Overloaded indicates to the client that the query never got accepted by a coordinator. Whereas a SERVER error indicates an unknown state, which even with an internal shotover error, could still occur (e.g. we flush the frame to the tcp buffer upstream, but then something busts internally). The Cassandra drivers all have user configurable retry policies, which also allow for retrying on server errors. |
@benbromhead that was the conclusion I had come to as well.
Oooooh maybe we can configure the cassandra_cpp driver to retry on Server error then. |
me read good
Yup we should be able to if it follows the patterns that all the other datastax based drivers do |
3f2ef35
to
b104da0
Compare
Changes:
Overloaded
errors instead ofServer
errors. This is needed because the cassandra_cpp drivers will terminate the connection onServer
errors but will allow the user to retry a failed message whenOverloaded
occurs.Result<Message, ResponseError>
I'm opening this up for review despite the unmerged prereq, the changes in
helpers/cassandra.rs
can be just ignored as they are a subset of those in #943