Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-214

PyMongo should replace self.__nodes with the host list returned by 'ismaster'.

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      All

      If 'ismaster' returns a list of hosts in a replica set the connection object calls self.__nodes.update() with the new list of node tuples. It should be replacing self.__nodes with the new host list. The current code causes two problems:

      1. When specifying hosts using a mongodb URI and 'localhost' we see this:

      >>> conn = pymongo.Connection('mongodb://localhost:27017,localhost:27018,localhost:27019/?slaveOk=true')
      >>> conn
      Connection(['localhost:27017', u'behackett-dt:27017', 'localhost:27019', 'localhost:27018', u'behackett-dt:27019', u'behackett-dt:27018'])

      2. If the mongodb URI includes an arbiter we could potentially try to run queries against it as seen here:

      http://groups.google.com/group/mongodb-user/browse_thread/thread/6a7bedcd552a0515#

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: