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

replSetInitiate fails if port not explicitly included in host

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.8
    • Affects Version/s: 1.5.6
    • Component/s: Replication
    • None
    • ALL

      1. Start two replica set servers that have not been initiated yet
      server> ./mongod --replSet yo/<host>:27018
      server> ./mongod --dbpath /data/db2 --port 27018 --replSet yo/<host>

      2. Start mongo shell connecting to first server
      client> ./mongo <host>/test

      3. Initiate replica set without specifying a port on one of the hosts thus assuming default port 27017
      client> rs.initiate({ _id: "yo", members: [

      { _id: 0, host: "<host>" }

      ,

      { _id: 1, host: "<host>:27018" }

      ] })
      {
      "assertion" : "need members up to initiate/reconfig, not ok: hannan.vpscustomer.com-1",
      "assertionCode" : 13144,
      "errmsg" : "db assertion failure",
      "ok" : 0
      }

      Works when port is explicitly given.

      Log from first server:
      Fri Jul 30 13:31:49 [conn1] replSet replSetInitiate admin command received from client
      Fri Jul 30 13:31:49 [conn1] replSet replSetInitiate config object parses ok, 2 members specified
      Fri Jul 30 13:31:55 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
      Fri Jul 30 13:31:55 [startReplSets] replSet have you ran replSetInitiate yet?
      Fri Jul 30 13:31:55 [startReplSets] replSet sleeping 20sec and will try again.
      Fri Jul 30 13:31:59 [conn1] replSet requestHeartbeat hannan.vpscustomer.com-1 : 9001 socket exception
      TEMP hb res cfg change:{}
      Fri Jul 30 13:31:59 [conn1] replSet replSetInitiate exception: need members up to initiate/reconfig, not ok: <host>-1
      Fri Jul 30 13:31:59 [conn1] query admin.$cmd ntoreturn:1 assertion command: { replSetInitiate: { _id: "yo", members: [

      { _id: 0.0, host: "<host>" }

      ,

      { _id: 1.0, host: "<host>:27018" }

      ] } } reslen:191 10028ms
      Fri Jul 30 13:32:05 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
      Fri Jul 30 13:32:05 [startReplSets] replSet have you ran replSetInitiate yet?
      Fri Jul 30 13:32:05 [startReplSets] replSet sleeping 20sec and will try again.

            Assignee:
            dwight@mongodb.com Dwight Merriman
            Reporter:
            tonyh Tony Hannan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: