-
Type:
Improvement
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Connection Management
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The latest 2.5 nightly has support for a setVersion field in the isMaster response. It looks like an integer value that is incremented after every replset reconfig.
The driver could use this field during replica set discovery process in the following way:
- keep track of the highest value for setVersion seen so far
- if an isMaster response has a higher setVersion that that, prefer its lists of hosts/passives/arbiters to those seen from any previous isMaster response
- if it has a lower setVersion, ignore the various hosts lists
- if the setVersion is equal, it should be the same list of hosts so nothing needs to be done
- if there is no setVersion, assume it's newer
Note that the setVersion is not incremented after an election, only after a reconfig.