[SERVER-69780] replicaset.py does not allow you to use a custom replica set name Created: 16/Sep/22 Updated: 17/Sep/22 Resolved: 17/Sep/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Vishnu Kaushik | Assignee: | Max Hirschhorn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Though the ReplicaSetFixture class has the option to pass in a replica set name, the name is overwritten and set to "rs" any time the "serverless" flag isn't in use. We want the ability to use the replica set name passed in even when the "serverless" flag isn't being used. |
| Comments |
| Comment by Vishnu Kaushik [ 16/Sep/22 ] | |||||||||||||||
|
max.hirschhorn@mongodb.com I actually hadn't run it yet, but I was just taking a look at how it's propagated to the shell and it looked like the code was faulty... and it works as expected, so sorry about the false alarm! | |||||||||||||||
| Comment by Max Hirschhorn [ 16/Sep/22 ] | |||||||||||||||
|
vishnu.kaushik@mongodb.com, can you post what resmoke invocation and YAML suite file contents you tried? The following is what I'm doing and the ?replicaSet connection string option is propagated to the mongo shell correctly.
| |||||||||||||||
| Comment by Didier Nadeau [ 16/Sep/22 ] | |||||||||||||||
|
vishnu.kaushik@mongodb.com with `serverless` mode we start without specifying a replica set name so the server can learn it through heartbeats/replSetStepUp. This change was made to allow this. I've taken a second look and I can recall why the `_init` does :
It's been a while and I haven't dealt with the Python code that much. I've done some change (remove the conditional block) and kicked off a patch to check the impact on the tests and better answer questions next week. Patch link | |||||||||||||||
| Comment by Vishnu Kaushik [ 16/Sep/22 ] | |||||||||||||||
|
Hmm unfortunately the driver connection URL we get from the fixture will not return the one under mongod_options.replSet but will use the name set in the ReplicaSetFixture itself. So even if I manually set the mongod_options section in the YAML file, when a hook requested the driver URL we would end up getting this constant name. So I think we should maybe change this method to return the correct replica set name? | |||||||||||||||
| Comment by Vishnu Kaushik [ 16/Sep/22 ] | |||||||||||||||
|
Thanks for pointing that out Max, I didn't realize that there was a separate mongod_options.replSet we can use. I think that should work. | |||||||||||||||
| Comment by Max Hirschhorn [ 16/Sep/22 ] | |||||||||||||||
|
vishnu.kaushik@mongodb.com, my understanding of the Python code is that you can set mongod_options.replSet in the YAML suite file to pass that --replSet value into mongod and resmoke will know to use that for its replSetInitiate command. It looks like Serverless introduced a separate mechanism for setting the replica set name because they aren't always using the --replSet option (
| |||||||||||||||
| Comment by Vishnu Kaushik [ 16/Sep/22 ] | |||||||||||||||