-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.0, 3.0.1
-
Component/s: None
-
None
-
(copied to CRM)
-
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.
- is duplicated by
-
PYTHON-931 pymongo tries to login at arbiter and fails
- Closed