Closed p-mongo closed 2 years ago
Also note that servers through 6.0 recognize ssl arguments, e.g.
serene2% /usr/local/m/versions/6.0/mongod --sslMode x
{"t":{"$date":"2022-05-18T18:17:27.450Z"},"s":"W", "c":"CONTROL", "id":23322, "ctx":"-","msg":"Option: sslMode is deprecated. Please use tlsMode instead."}
{"t":{"$date":"2022-05-18T18:17:27.451Z"},"s":"F", "c":"CONTROL", "id":20574, "ctx":"-","msg":"Error during global initialization","attr":{"error":{"code":2,"codeName":"BadValue","errmsg":"unsupported value for tlsMode x"}}}
mlaunch is therefore rejecting valid server arguments for 4.4-6.0.
mlaunch conditionally defines which options it supports based on server version that it is launching. Specifically it either uses tls names or ssl names.
There are a few aspects to this:
mlaunch
checks the supported parameters reported by mongod --help
mlaunch
assumes TLS options for MongoDB >= 4.2.0 to be consistent with mongod --help
mlaunch
passes through unknown parameters to mongod
and mongos
unless an exception has been added.SSL vs TLS options don't fix the expected pattern because:
mongod --help
for 4.2+I noticed your test suite is still using the deprecated --ssl options with 4.4. Do you still need to test on EOL versions of MongoDB, or could your incantations be updated to the modern --tls defaults?
Drivers support 3.6+ servers presently.
Workaround which appears to work through 6.0: https://github.com/p-mongodb/mtools-legacy/commit/886a2e50238a139ac3a206ab5f53779635d9d2a0
mlaunch conditionally defines which options it supports based on server version that it is launching. Specifically it either uses tls names or ssl names.
This is problematic when mlaunch is used to launch various server versions, because it obligates mlaunch's clients to conditionally formulate arguments to mlaunch when mlaunch is aware of both types of arguments.
Worse, mlaunch simply ignores the ssl arguments which causes it to misbehave, specifically it launches deployment with wrong configuration:
Since mlaunch is aware of both groups of arguments, I think it should accept both forms and translate to the correct one for the server being launched automatically.
I am also curious how mlaunch knows which of these groups of arguments to define, given that path to server is another argument - does the path have to be specified ahead of tls arguments or does tls argument processing gets delayed somehow?