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

Replica set connections do not verify correctness of members

      This can happen if a replica set member is removed from the replica set (by local configuration on that member) but not removed from the seed list used by clients.

      Set up is as follows:

      • A: Primary member of a replica set called bob
      • B: Secondary member of a replica set called bob
      • C: Secondary member of a replica set called bob

      A, B and C are used as seeds to MongoClient (and MongoClient is told that the replica set is called bob via the replicaSet argument).

      C has its local configuration changed to remove it from the replica set and it is restarted. Now we have:

      • A: Primary member of a replica set called bob
      • B: Secondary member of a replica set called bob
      • C: A server that considers itself not part of any replica set
      • The replica set configuration on A and B still thinks C is in the replica set (but correctly records it as unavailable).
      • The seed information on clients still contains A, B and C

      In this case, the monitor in pyMongo will run an ismaster on C and determine that C is a master. Whilst this is technically accurate, it has failed to check that C is part of the expected replica set.

      We've put a temporary fix in our local copy of mongo_replica_set_client.py:Member.update that checks to see if the member is part of any replica set but we couldn't do a complete fix as the replica set information configured in the client has not been passed through to this point.

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

              Created:
              Updated:
              Resolved: