mongodb/mongo-python-driver — pull request #217 by KonishchevDmitry (2013-11-21 14:11:32+00:00)
Title: PYTHON-600: Fix a bug in Replica Set monitoring in split brain situation

Suppose you have a Replica Set and a MongoReplicaSetClient connection to it which you don't close.

1. At some time you get a split brain situation and a part of the Replica Set nodes become isolated from others. MongoReplicaSetClient.refresh() will remove them from its RSState and will monitor only the other part of nodes.
2. After some time your host loses connection to the second part of nodes. Replica Set monitor will continue to monitor only the second part of nodes.
3. And finally after some time connection to the first part of nodes resumes but to the second part not. But the Replica Set monitor continues to monitor only the second part of nodes and your connection won't work until at least one host from the second part become available.

This Pull Request fixes the issue.