I misspoke, yes, the apps have to retry, but with pymongo, the apps have to retry only once (after receiving an exception), on the second try pymongo keeps the IO enqueued until the failover is complete [1]. With mongos, each time an exception is returned, so the apps have to keep retrying until the failover is complete.
Since posting here I found a code from Jesse Davis (from MongoDB), where in pymongo driver, using MongoClient, he connects to the mongos as well as all the shard servers (mongods) [2]. Is that the way to implement a sharded cluster?
- Umesh