rueckstiess / mtools

A collection of scripts to set up MongoDB test environments and parse and visualize MongoDB log files.
Apache License 2.0
1.88k stars 400 forks source link

Provide a way to pass unknown to mlaunch parameters to mongod #677

Closed p-mongo closed 5 years ago

p-mongo commented 5 years ago

I tried to use the following flag to mongod to limit journal size:

./mongod --dbpath /tmp/test --wiredTigerEngineConfigString="log=(prealloc=false,file_max=20MB)"

When I passed this flag (either as spelled above or without the = between the name and the value) to mlaunch, I get:

warning: ignoring unknown argument --wiredTigerEngineConfigString for /usr/local/m/versions/4.0.0/bin/mongod

... and the flag gets dropped from the command line.

It is reasonable to assume that mlaunch will always be behind mongod in development, and thus there will be flags that mongod recognizes that mlaunch does not know about. There should be a way to pass such flags to mongod via mlaunch.

Expected behavior

There should be a way to pass flags/options that mlaunch does not know about to mongod.

Actual/current behavior

Options that mlaunch does not recognize are dropped.

Steps to reproduce the actual/current behavior

  mlaunch --replicaset --dir $dir --name ruby-driver-rs \
    --wiredTigerEngineConfigString "log=(prealloc=false,file_max=20MB)" \
    --binarypath /usr/local/m/versions/4.0.0/bin --port 27100 

Environment

Software Version
mtools 1.4.1
MongoDB server 4.0.0
Operating system Debian
stennie commented 5 years ago

It is reasonable to assume that mlaunch will always be behind mongod in development, and thus there will be flags that mongod recognizes that mlaunch does not know about. There should be a way to pass such flags to mongod via mlaunch.

mlaunch validates params against what the mongod or mongos binary claims to accept via --help so that it can warn about unknown parameters.

Your example is a rare case of an undocumented parameter, but this can be added to an exception list.

Cheers, Stennie