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

Invalid replica set connection management

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Blocker - P1 Blocker - P1
    • None
    • Affects Version/s: 2.0.6
    • Component/s: Replication
    • Labels:
      None
    • Environment:
      Irrelevant
    • ALL

      When server already runs a MongoDB instance on default port and default (hostname-determined) IP address, initializing another instance with the same port but different IP address fails.
      We have server with 2 interfaces, ip1 and ip2. server hostname resolves to ip1. ip1 hosts a node of replica set called "A". I want to have a node of another replica set called "B" to be hosted on ip2.
      The "A" RS node has bind_ip=ip1,127.0.0.1 and "B" RS node has bind_ip=ip2. After initiating RS "B" on the node (using rs.initiate()) I get the "[rsStart] replSet exception loading our local replset configuration object : 13132 nonmatching repl set name in _id field; check --replSet command line" which is obviously wrong since I make sure that the node data directory was clean before. I spent two hours trying to diagnose the problem. Solution was subtle - I had to change port from default one to another one, and it worked. Now it appears that RS code tries to do some "magic" using host names and ips and connects to wrong ip address, determines the "wrong replica set name" and then bails out.

      This was very frustrating and I hope you will fix this soon. Also the message might disclose a little more information (for example what replica set name was encountered instead of the expected one). I think I've seen the case that was asking for that, but can't find this now.
      Also, I believe that connecting to a wrong machine might lead to disastrous events in case of same-named but different replica sets.

      And while you're at it, please fix the "mongo host" vs "mongo host.zone" problem (if there are no dots in name, shell always tries local host instead of host, relative to search order, specified in resolv.conf), I think it's the same problem.

            Assignee:
            Unassigned Unassigned
            Reporter:
            onyxmaster Aristarkh Zagorodnikov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: