Adding support for Replica Sets #16

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
7 participants
  • Supporting for multiple hosts and mongo uri's (using uri_parse)
    • Client('foo', host='mongodb://localhost:27017,localhost:27018/test')
    • Client('foo', host=['localhost:27017', 'localhost:27018'], dbname='test')
      and keeping the old:
    • Client('foo', host='localhost', port=27017, dbname='test')
  • Increasing required pymongo to 2.0 for uri_parse
  • Creating a new Connection() is now asynchronous
    • must be passed a callback which is called with the connected connection
  • Updating Connection's to replSets to behave the same way as pymongo
  • Adding Pool.command to run db commands
  • Making .gitignore more vim friendly

Shawn MacIntyre added some commits Sep 20, 2011

Shawn MacIntyre Adding support for Replica Sets.
* Supporting for multiple hosts and mongo uri's (using uri_parse)
  - Client('foo', host='mongodb://localhost:27017,localhost:27018/test')
  - Client('foo', host=['localhost:27017', 'localhost:27018'], dbname='test')
  and keeping the old:
  - Client('foo', host='localhost', port=27017, dbname='test')
* Increasing required pymongo to 2.0 for uri_parse
* Creating a new Connection() is now asynchronous
  - must be passed a callback which is called with the connected connection
* Updating Connection's to replSets to behave the same way as pymongo
* Adding Pool.command to run db commands
* Making .gitignore more vim friendly
7c2af31
Shawn MacIntyre Fixing error reporting when no node is found 3075dcf
Shawn MacIntyre Fixing overly agressive exception catching in callbacks 33c6cc4

Fixed bug where we were catching all exceptions happening in callbacks passed to asyncmongo cursors.

Owner

jehiah commented Oct 10, 2011

thanks for your work on Replica Set support; I've just merged in support for authentication, which similar to replica set support requires a round trip to the server before a connection is ready to use.

I think there is a lot of good code in what you've added so far, but I think an ideal implementation would be to have the replica support handled transparently at connect time so that is' simple to handle reconnects and keeping a pool of connections.

philwhln commented Dec 3, 2011

This looks like just what I need. Thanks for implementing it!

philwhln and others added some commits Dec 6, 2011

@philwhln philwhln Fix bug with connection being returned to the pool prematurely when l…
…ooking for master node. Would cause ProgrammingError('connection already in use'), although this exception is not being passed up and is appearing as 'connection closed'
7892c29
Shawn MacIntyre Merge pull request #1 from philwhln/master
fixed bug with "Adding support for Replica Sets"
1b0ffb1

dkador commented Feb 14, 2012

Any idea when this might get pulled into head? Would love to take advantage of it very soon.

@dkador This needs to be cleaned up before it gets pulled. I'm currently swapped, I'll look at cleaning it up after GDC.

dkador commented Feb 15, 2012

Cool, thanks for the reply (and the overall effort).

On Tuesday, February 14, 2012 at 6:14 PM, Shawn MacIntyre wrote:

@dkador This needs to be cleaned up before it gets pulled. I'm currently swapped, I'll look at cleaning it up after GDC.


Reply to this email directly or view it on GitHub:
#16 (comment)

Hi,

I would really like to test out this feature. Is there an estimate of when replica sets will be fully functional with asyncmongo?

Thanks!

I would really like to test out this feature. Is there an estimate of
when replica sets will be fully functional with asyncmongo?

I've been using this code for a while now without issue.

For me it didn't work when I tried it a few days. User authentication was not working. When I looked at the code, I saw some notes saying that authentication is not implemented yet.....

MBA

Sorry, I'm not using user authentication, so that's probably still true.

So is the communication between your replica sets not authenticated? Or perhaps there is a way to get node-to-node authentication to work without turning on the user authentication; just using the keyfiles? thanks!

So is the communication between your replica sets not authenticated? Or
perhaps there is a way to get node-to-node authentication to work without
turning on the user authentication; just using the keyfiles? thanks!

It's not authenticated at all. It's deployed on a private dedicated
cluster, so not needed.

I see. Thanks. I guess I'll wait until someone will get to finally fixing authentication... I really need it to work, as my servers are in different facilities.

philwhln commented Apr 6, 2012

I've found this does not work with the latest tornado facebook/tornado/master

_NodeFound exceptions are not caught

Yes, this not work for me too with last version tornado

Using "git bisect" this seems to have started failing with this tornado commit...

tornadoweb/tornado@2db0ace

tornadoweb/tornado@2db0ace is the first bad commit
commit tornadoweb/tornado@2db0ace
Author: Ben Darnell ben@bendarnell.com
Date: Sun Feb 19 19:50:01 2012 -0800

Further refactoring of duplicated IOStream logic

Hi everyone,

Just wondering whether there were any updates on this? Thanks!

MBA

@philwhln Thanks! Looks like Motor might end up a better solution in the long term than asyncmongo. Unfortunately my project is nearing release, so I can't change my code to use it. I'll definetely check it out for my next projects.

Any idea what is planned for Motor in the long term? Looks like it will be part of the official pymongo eventually, right?

MBA

It will be able to maintain 100% feature compatibility with pymongo, which
is important. It's developed by @ajdavis from 10gen, so I think it will be
officially supported at some point.

It only took me a few hours to port my code over from asyncmongo, but I
know everyone's code if different. It helped that I had a pretty thorough
test suite to bash it with.

Contributor

ajdavis commented Dec 14, 2012

Hi, yes, the plan is for Motor to join the PyMongo official distro in January. Meanwhile, here's the info on it:

http://emptysquare.net/motor/

Owner

jehiah commented Apr 3, 2013

closing based on work in #58

jehiah closed this Apr 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment