Allow reconfiguring repl set without having `configsvr: true` in the config

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Sharding NYC
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Right now if you attempt to use `ReplSetTest` with the auto bootstrap procedure it will fail on this line: https://github.com/10gen/mongo/blob/517336c7974119374c239b0b61cdd51f32c91bbd/src/mongo/shell/replsettest.js#L1441-L1442 saying that "Nodes started with the --configsvr flag must have configsvr:true in their config". 

      This is happening because configsvr:true is not in the config when we are reconfiguring the first auto-bootstrapped node. We can add something like the following in `ReplSetTest.prototype.getReplSetConfig` to fix the problem:

              // Auto-bootstrapped nodes (i.e started without --shardvr) are config servers and need the
              // configsvr field set.
              if (this.useAutoBootstrapProcedure) {
                  const nodeOption = this.nodeOptions["n0"];
                  const nodeOptionsHasShardsvr =
                      typeof (nodeOption) == "object" && nodeOption.hasOwnProperty("shardsvr");
                  const startOptionsHasShardsvr = this.startOptions != undefined &&
                      typeof (this.startOptions) == "object" &&
                      this.startOptions.hasOwnProperty("shardsvr");                        if (!nodeOptionsHasShardsvr && !startOptionsHasShardsvr) {
                      cfg.configsvr = true;
                  }
              }

      Or alternatively we can just disable the checks for the configsvr field since we are deprecating that field anyways. 

            Assignee:
            Wenqin Ye
            Reporter:
            Wenqin Ye
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: