[JAVA-859] Use setVersion field in isMaster for replica set discovery Created: 21/Jun/13  Updated: 03/Apr/14  Resolved: 07/Nov/13

Status: Closed
Project: Java Driver
Component/s: Connection Management
Affects Version/s: None
Fix Version/s: 2.12.0, 3.0.0

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Depends
Sub-Tasks:
Key
Summary
Type
Status
Assignee
JAVA-994 2.12: Use setVersion field in isMaste... Sub-task Closed Jeffrey Yemin  
JAVA-995 3.0: Use setVersion field in isMaster... Sub-task Closed  

 Description   

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:

  1. keep track of the highest value for setVersion seen so far
  2. 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
  3. if it has a lower setVersion, ignore the various hosts lists
  4. if the setVersion is equal, it should be the same list of hosts so nothing needs to be done
  5. if there is no setVersion, assume it's newer

Note that the setVersion is not incremented after an election, only after a reconfig.



 Comments   
Comment by auto [ 29/Aug/13 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-859: Use setVersion field in isMaster for replica set discovery.
Ignore the hosts/arbiters/passives lists from a member with an older setVersion than has been received from a previous notification from another server.
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/65ec95ef39e8a38374e584ef26e03490d20a2474

Generated at Thu Feb 08 08:53:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.