Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-24280

Starting from 3.2.5 if bind_ip is set to 0.0.0.0 it will end up in the replica set config if rs.initiate() is executed with no arguments

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.2.5
    • Fix Version/s: 3.3.8
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Steps To Reproduce:
      Hide
      • Start a mongod instance with replSet enabled and bind_ip set to 0.0.0.0
      • In mongo shell execute rs.initiate()
      • Check the rs.config() or rs.status() and check the "name" value - it will be "0.0.0.0:<port>"
      Show
      Start a mongod instance with replSet enabled and bind_ip set to 0.0.0.0 In mongo shell execute rs.initiate() Check the rs.config() or rs.status() and check the "name" value - it will be "0.0.0.0:<port>"
    • Sprint:
      Security 15 (06/03/16)
    • Case:

      Description

      That must be a regression from SERVER-23838 as pointed by Kevin Pulo.

      It leads to weird consequnces such as if other replica set members specified with the correct host names, they may consider themselves to be the member with the name that contains "0.0.0.0" and will actually try to heartbeat themselves:

      "taken from a remote member"

      2016-05-23T15:03:13.588-0700 I REPL     [ReplicationExecutor] New replica set config in use: { _id: "MMS", version: 1, protocolVersion: 1, members: [ { _id: 0, host: "0.0.0.0:28107", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, tags: {}, slaveDelay: 0, votes: 1 } ], settings: { chainingAllowed: true, heartbeatIntervalMillis: 2000, heartbeatTimeoutSecs: 10, electionTimeoutMillis: 10000, getLastErrorModes: {}, getLastErrorDefaults: { w: 1, wtimeout: 0 }, replicaSetId: ObjectId('57437e1f88f956063b96e00c') } }
      2016-05-23T15:03:13.588-0700 I REPL     [ReplicationExecutor] This node is 0.0.0.0:28107 in the config
      ...
      2016-05-23T15:04:29.958-0700 W REPL     [ReplicationExecutor] Got error (BadValue: Received heartbeat from member with the same member ID as ourself: 0) response on heartbeat request to hostnameX:28107; { ok: 1.0, hbmsg: "" }

      The workaround is to specify host names or unique IP addresses explicitly:

      var cfg = {
            _id: "testRS",
            version: 1,
            members: [
               { _id: 0, host : "host1:27017"},
               { _id: 1, host : "host2:27017"},
               { _id: 2, host : "host3:27017"}
            ]
         };
      rs.initiate(cfg);
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: