Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1161

A replica set member that doesn't report its name results in removal of all servers from the client view of the replica set

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.12.1, 3.0.0
    • 2.12.0
    • Cluster Management
    • None

    Description

      A server started with --replSet <name> return this ambiguous ismaster response in at least three situations:

      1. an uninitialized replica set
      2. a shunned state (shunned is when the server was removed from the replica set configuration)
      3. 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.

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: