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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.2.5
    • 3.3.8
    • Replication
    • None
    • Fully Compatible
    • ALL
    • 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>"
    • Security 15 (06/03/16)

    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

              andreas.nilsson Andreas Nilsson
              dmitry.ryabtsev@mongodb.com Dmitry Ryabtsev
              Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: