-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.12.0
-
Component/s: Cluster Management
-
None
A server started with --replSet <name> return this ambiguous ismaster response in at least three situations:
- an uninitialized replica set
- a shunned state (shunned is when the server was removed from the replica set configuration)
- briefly on member startup
For example:
{ "serverUsed" : "localhost:27017" , "ismaster" : false , "secondary" : false , "info" : "can't get local.system.replset config from self or any seed (EMPTYCONFIG)" , "isreplicaset" : true , "maxBsonObjectSize" : 16777216 , "maxMessageSizeBytes" : 48000000 , "localTime" : { "$date" : "2014-04-01T14:10:05.110Z"} , "ok" : 1.0 }
Note: isreplicaset exists in only these states and there is no hosts field, nor setName nor setVersion to work with.
The problem is that the driver doesn't detect this state, and proceeds to remove all other replica set members from the client view of the cluster. This can result in the inability to perform operations against the cluster until the MongoClient instance is closed and re-created.
Instead, the driver should ignore server descriptions for replica set members that don't contain a hosts field or a setName field.
- related to
-
SERVER-13458 Identify replica state in ismaster for uninitialized and shunned states
- Closed