[SERVER-9034] Return rs config version from isMaster Created: 20/Mar/13  Updated: 10/Nov/15  Resolved: 11/Jun/13

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 2.5.1

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: ismaster
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CSHARP-796 Utilize setVersion in isMaster Reponse Closed
is depended on by SERVER-5058 mongos should update config seed base... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

This will allow clients to detect replica set changes if they are interested. Will be used by mongos to update shard seeds entries in config db.



 Comments   
Comment by Eric Milkie [ 12/Jun/13 ]

That's right, if the config changes the composition of the members, then definitely prefer a higher config version.

Comment by Jeffrey Yemin [ 12/Jun/13 ]

Let's say a driver makes concurrent calls to isMaster on all currently known members. The first one comes back with a list of hosts [a, b, c] and setVersion : 3. The next one comes back with a list of hosts [a, c, d] and setVersion : 2. In this case the driver can discard the results of the second call because it's staler than the previous isMaster result.

Comment by Eric Milkie [ 12/Jun/13 ]

What's a replica set state – do you mean a member state such as SECONDARY or PRIMARY? That won't be in isMaster.
Or do you mean the config version.. if so, and you get different config versions back from various nodes, that should be a transient condition that will eventually end up the same everywhere, so I don't think it would help to use it to help choose a node to talk to.

Comment by Scott Hernandez (Inactive) [ 12/Jun/13 ]

Or just to detect when changes to the config have occurred, which is what mongos will use it for.

Comment by Jeffrey Yemin [ 12/Jun/13 ]

Could drivers use this to decide on a winner in the case where different replica set members are reporting different replica set states from isMaster?

Comment by Eric Milkie [ 08/Jun/13 ]

The new ismaster.js test does not run with auth:
http://buildlogs.mongodb.org/Nightly%20Linux%2064-bit%20Subscription%20SUSE%2011/builds/401/test/replica%20sets/ismaster1.js

Comment by Matt Dannenberg [ 07/Jun/13 ]

In the docs, mention that the config version is included in the isMaster() response.

Comment by auto [ 07/Jun/13 ]

Author:

{u'username': u'dannenberg', u'name': u'Matt Dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-9034 Return rs config version from isMaster

also bulked out the replset/ismaster1.js jstest
Branch: master
https://github.com/mongodb/mongo/commit/80261daed7582d538cddd855c38b69b8adf2f3db

Generated at Thu Feb 08 03:19:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.