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

Auth can fail while connecting to replset with recovering members

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.2
    • Affects Version/s: 3.0, 3.0.1
    • Component/s: None
    • None
    • Fully Compatible

      While a new member joins a replica set its state is RECOVERING, and auth fails against it until it has replicated the primary's auth schema. PyMongo's database.authenticate() prefers to auth against the primary, but if you call authenticate immediately, before the primary is discovered:

      client = MongoClient(hosts, replicaSet='rs')
      client.db.authenticate(user, passwd)
      

      ... then PyMongo may discover the recovering member and attempt auth against it, instead.

      authenticate() should select only secondaries, if no primary is available. It should never use a recovering member.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: