-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add support for retries #60
Conversation
proxy/proxy_retries_test.go
Outdated
{ // Error response (truncate), retry until succeeds or exhausts query plan | ||
idempotentQuery, | ||
&message.TruncateError{ErrorMessage: "Truncate"}, | ||
"cql error: ERROR UNAVAILABLE (code=ErrorCode Unavailable [0x00001000], msg=No more hosts available (exhausted query plan), cl=ConsistencyLevel ANY [0x0000], required=0, alive=0)", |
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.
This should probably not verify against the exact error string. This is a bit fragile.
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.
Looks good to me, I added a couple of questions and a couple of tiny suggestions regarding the tests.
I always read tests first because I see them as a kind of documentation when I'm reading new code and it was pretty easy to follow the expected behavior of the code by following your tests 👍
This is the final issue that fixes: #3. Previous PRs added the ability to detect if requests are idempotent. With this information and a retry policy we can automatically handle a number of server-side failures that are usually handled by the driver, but would not be possible with driver though the proxy (because its view is a single node cluster).