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

Can't add replica to set when it is not already in config

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.6.5
    • Component/s: None
    • None
    • ALL

      Start three nodes, add them to a replica set using the instructions on
      http://www.mongodb.org/display/DOCS/Replica+Set+Tutorial

      Now we follow these steps to add a new member from a backup:
      http://www.mongodb.org/display/DOCS/Adding+a+New+Set+Member

      But it doesn't go as well as the docs suggest. Here's what happens.

      Create a new data directory /data/r3 and copy files from another mongod's data directory. Start up a new node using

      mongod --replSet foo --port 27020 --dbpath /data/r3 --fastsync

      This new mongod will log an error about not being in the replica set config. This error looks like (from Windows binary):

      Tue Mar 08 22:39:15 [startReplSets] replSet error can't find self in the repl set configuration:
      Tue Mar 08 22:39:15 [startReplSets] { _id: "foo", version: 1, members: [

      { _id: 0, host: "localhost:27017" }

      ,

      { _id: 1, host: "localhost:27018" }

      ,

      { _id: 2, host: "localhost:27019" }

      ] }
      Tue Mar 08 22:39:15 [startReplSets] Assertion failure false db\repl\rs.cpp 336
      Tue Mar 08 22:39:15 [startReplSets] replSet error loading configurations 0 assertion db\repl\rs.cpp:336
      Tue Mar 08 22:39:15 [startReplSets] replSet error replication will not start
      Tue Mar 08 22:39:15 [startReplSets] replSet error loading set config
      Tue Mar 08 22:39:15 [startReplSets] replSet error fatal, stopping replication
      Tue Mar 08 22:39:15 [startReplSets] replSet ~RSBase called
      Tue Mar 08 22:39:15 [startReplSets] replSet caught exception in startReplSets thread: assertion db\repl\rs.cpp:336

      Ok, well then maybe we just need to do rs.add("localhost:27020") from the master. Do that, restart the new mongod, it still fails with the same error. Now what?

      Is the implication here that you can only restore from backups that include the new set member in the replica set config before taking the backup?

            Assignee:
            kristina Kristina Chodorow (Inactive)
            Reporter:
            andrew311 Andrew
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: