Skip to content

Support embeddedcrs#913

Open
renatoriccio wants to merge 4 commits into
rueckstiess:developfrom
renatoriccio:support_embeddedcrs
Open

Support embeddedcrs#913
renatoriccio wants to merge 4 commits into
rueckstiess:developfrom
renatoriccio:support_embeddedcrs

Conversation

@renatoriccio

Copy link
Copy Markdown

Description of changes

Support Embedded config servers

Usage:
`
Will start 1 config server/shard + 1 shard
./mlaunch.py init --sharded=2 --embeddedcsrs --replicaset --node 1

Will start 1 config server/shard
./mlaunch.py init --sharded=1 --embeddedcsrs --replicaset --node 1
`

@stennie stennie requested a review from Copilot May 29, 2026 06:41
@stennie stennie self-assigned this May 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for MongoDB “embedded config server replica set” (embedded CSRS) mode in mlaunch init, including a new CLI flag and related runtime/listing behavior, plus macOS-specific process launching adjustments.

Changes:

  • Add --embeddedcsrs flag and init-time logic to size config members and adjust shard count for embedded-CSRS topologies.
  • Run transitionFromDedicatedConfigServer during sharded init when embedded-CSRS is enabled.
  • Update list() output labeling for config nodes, and adjust macOS process launching (nohup + backgrounding).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mtools/mlaunch/mlaunch.py
Comment on lines +293 to 296
init_parser.add_argument('--config', action='store', default=-1,
type=int, metavar='NUM',
help=('adds NUM config servers to sharded '
'setup (requires --sharded, default=1)'))
Comment thread mtools/mlaunch/mlaunch.py
Comment on lines +683 to +686
# Check if embedded is used, if it's the case the number of shards should be decremented by 1
if self.args['embeddedcsrs'] and 'sharded' in self.args and self.args['sharded']:
if len(self.args['sharded']) == 1:
self.args['sharded'][0] = str(int(self.args['sharded'][0]) - 1)
Comment thread mtools/mlaunch/mlaunch.py
Comment on lines +812 to +815
if self.args['embeddedcsrs']:
print("Configuring embedded config servers")
con = self.client('localhost:%i' % mongos[0])
con.admin.command({'transitionFromDedicatedConfigServer': 1})
Comment thread mtools/mlaunch/mlaunch.py
Comment on lines +1054 to +1058
# temporary list used to find the list of running nodes
tmp_config_list = []
string_config = "config server"
for node in sorted(self.get_tagged(['config'])):
doc = OrderedDict([('process', 'config server'),
if self.cluster_running[node]:
Comment thread mtools/mlaunch/mlaunch.py
Comment on lines +2178 to +2183
if sys.platform == 'darwin':
command_str = ("nohup \"%s\" %s --dbpath \"%s\" --logpath \"%s\" "
"--port %i"
"%s %s >/dev/null &" % (os.path.join(path, 'mongod'), rs_param,
dbpath, logpath, port, auth_param,
extra))
Comment thread mtools/mlaunch/mlaunch.py
Comment on lines +2244 to +2252
mongos = sorted(self.get_tagged(['mongos']))
con = self.client('localhost:%i' % mongos[0], readPreference="primaryPreferred")
try:
if con['config']['shards'].find_one({ '_id': 'config' }):
return True
return False
except OperationFailure:
print("WARNING: Unable to check if config server is embedded")
return False
Comment thread mtools/mlaunch/mlaunch.py
Comment on lines +298 to +299
init_parser.add_argument('--embeddedcsrs', default=False, action='store_true',
help=('use embedded CSRS (only for MongoDB 8.0.0+), default=False'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants