[SERVER-81469] Allow reconfiguring repl set without having `configsvr: true` in the config Created: 26/Sep/23  Updated: 03/Nov/23  Resolved: 03/Nov/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Wenqin Ye Assignee: Wenqin Ye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding NYC
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 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. 



 Comments   
Comment by Githook User [ 02/Nov/23 ]

Author:

{'name': 'Wenqin Ye', 'email': 'wenqin908@gmail.com', 'username': 'wenqinYe'}

Message: SERVER-81469: Allow reconfiguring repl set without having `configsvr: true` in the config
Branch: master
https://github.com/mongodb/mongo/commit/ab907a2035b3b305ca1e10dca1b0e8577d455f8d

Comment by Wenqin Ye [ 12/Oct/23 ]

After thinking about it more and discussing with Randolph, we decided we won't do this ticket. Our reasoning is that this error only occurs if someone uses auto-bootstrap with a  ReplSetTest, but one should not directly use auto-bootstrapping with just ReplSetTest as it does not set up a mongos to connect to the node. Instead if someone wants to get an auto-bootstrapped node they should use ShardingTest instead. 

Generated at Thu Feb 08 06:46:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.