Support MongoDB replica set connections / clients#31
Open
YoavShapira wants to merge 13 commits intoslacy:masterfrom
Open
Support MongoDB replica set connections / clients#31YoavShapira wants to merge 13 commits intoslacy:masterfrom
YoavShapira wants to merge 13 commits intoslacy:masterfrom
Conversation
…rk without them too.
…rk without them too.
Contributor
|
Definitely useful. Lets us use minimongo on production servers where failover is a necessity. |
Author
|
BTW: (1) Sorry for not writing unit tests. I was getting general failures running unit tests without any of my code modifications, and I opened an issue for that (issue #30). (2) I can squash commits if needed, into one prettier-looking commit message. |
|
I agree this change is good and actually went ahead and implemented it in my own fork. Also using minimongo in production and see this as a valuable asset. |
ChangJoo-Park
added a commit
to ChangJoo-Park/minimongo
that referenced
this pull request
Aug 23, 2019
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 pull requests modifies options.py and model.py so that they support connecting to a MongoDB replicaset using the high-availability MongoReplicaSetClient.
Documentation for this client is available at http://api.mongodb.org/python/current/examples/high_availability.html.
This pull request updates the minimum required version of PyMongo from 1.9 to 2.4 on purpose, which is also done in the one other open pull request. This is needed not just for the high-availability client but also for MongoDB 2.2+ itself.
When replica sets are not configured, the behavior is the same as before, except it uses the current MongoClient instead of the old, deprecated Connection class.
While I was in there, I added a bit of DEBUG-level logging.