Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1058

Force replSetReconfig in mongodb C# driver

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Blocker - P1
    • Resolution: Gone away
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: API, Bson, Configuration
    • Labels:

      Description

      I've been on forums talking with several people for the last few days and no one has been able to give me an answer.

      Is there anyway to reconfigure a replica set in the event the primary as well as a majority of the servers are down? For example if data center 1 goes down, a procedure can be run to reconfigure and set a new primary with the remaining servers?

      I tried the eval method on the database object and I get this:
      "Command '$eval' failed: not master (response:

      { "note" : "from execCommand", "ok" : 0.0, "errmsg" : "not master" }

      )"

      I also tried this:
      var reconfigCommand = new CommandDocument
      {
      {"replSetReconfig", new BsonDocument{{"configuration", newConfig},

      {"force", true}

      }}
      };

      var response = database.RunCommand(reconfigCommand);

      And RunCommand throws the following MongoCommandException

      Command 'replSetReconfig' failed: replSetReconfig command must be sent to the current replica set primary. (response:

      { "ok" : 0.0, "errmsg" : "replSetReconfig command must be sent to the current replica set primary." }

      )

      From what I can tell in the documentation, force = true should allow reconfig against a non-primary database.

      Any suggestions?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              stephenw Stephen Weaver
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: