Retry on mongos operation failures#692
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
"could not get last error" and "connection attempt failed" are others I think you should add here.
Contributor
|
Thank you for writing this. As mentioned, I'll do a series of failover tests on Tuesday and will report back. |
Contributor
|
Success! You need to merge in #693 to this, but then it's fantastic. We did various stepdowns and |
Contributor
Author
|
Great! |
durran
force-pushed
the
retry-mongos
branch
from
September 30, 2015 15:09
59cf0ed to
9caa302
Compare
This file contains hidden or 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
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.
This adds additional read retry scenarios on
OperationFailures coming from a mongos only. This is because thepingthat is executed against a running mongos always returns ready no matter what the state of the cluster behind it is, and the normal server selection/socket retry will not cover this scenario.max_read_retriesconfiguration option that is only applicable to sharded clusters when specificOperationFailures are raised.read_retry_intervalconfiguration option to set the wait time between retries.Note that we can only look at the error messages themselves, and not the codes. The codes have changed between server versions and some are not relevant to the same scenario anymore, such as the commented 15988 - which was previously an "error querying server" in mongos but in 3.0 is a "FieldPath field names may not be empty strings", which is not a retryable error.
We don't scan the cluster in these scenarios as the mongos is up and running, and the scan would be a waste of a network call do to the
pingreasons stated above.