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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • None
    • None
    • None
    • Sharding NYC
    • Fully Compatible
    • ALL

    Description

      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. 

      Attachments

        Activity

          People

            wenqin.ye@mongodb.com Wenqin Ye
            wenqin.ye@mongodb.com Wenqin Ye
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: