Shane
(Shane Harvey)
2
Yes, starting in 4.0 pymongo will automatically connect to the entire replica set even if only one host is given unless directConnection is set to True, see: PyMongo 4 Migration Guide - PyMongo 4.6.3 documentation
However, this should not result in too many connections being opened to the primary unless the app is setting minPoolSize. Are you using minPoolSize? Can you share how you’re creating your MongoClient(s) including settings and how many get created?
Note that there was never a way to connect with a seedlist and discover the replica set secondaries without ever connecting to the primary.
2 Likes