[SERVER-74845] Create mechanism to ignore ignore fork option with systemd Created: 14/Mar/23  Updated: 29/Oct/23  Resolved: 23/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0, 4.4.20, 5.0.16, 6.0.6

Type: Improvement Priority: Major - P3
Reporter: Ryan Egesdahl (Inactive) Assignee: Ryan Egesdahl (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-74345 mongodb-org-server 4.4.19, 5.0.15, 6.... Closed
is depended on by DOCS-15962 [Server] New startup flag and conf ch... Backlog
Duplicate
is duplicated by SERVER-74506 Revert backwards-incompatible systemd... Closed
Problem/Incident
is caused by SERVER-70121 Ubuntu 18 packaging tests shows error... Closed
Related
related to SERVER-76179 "/var/run/mongodb/"mongod.pid" delete... Closed
is related to DOCS-15962 [Server] New startup flag and conf ch... Backlog
Backwards Compatibility: Fully Compatible
Backport Requested:
v6.0, v5.0, v4.4
Participants:
Case:

 Description   

As an alternative to SERVER-74506 when solving SERVER-74345, we can instead simply detect systemd on startup and ignore the fork option. This will have the effect of keeping our desired behavior and making it both backwards- and forwards- compatible. We should ensure the behavior is logged so any observant users understand the behavior change.



 Comments   
Comment by Githook User [ 25/Mar/23 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-74845 Override processManagement.fork in mongod.service

(cherry picked from commit 26b4106ddaac866c5b4b9f630e462fd7c7e9b53d)
(cherry picked from commit 7ee56cd76001be3efdb42bad292d83ea062b6aaf)
(cherry picked from commit 902f12d4af4d7b9ba4f813c4e351f69cfa19561d)
Branch: v4.4
https://github.com/mongodb/mongo/commit/9a145901c341dab5786ef0605d000645b1e9adec

Comment by Githook User [ 25/Mar/23 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-74845 Add environment variable override for processManagement.fork

(cherry picked from commit 7a722b6621d900e9f9a81fdea27160104dce2055)
(cherry picked from commit 965012e67dca663c5a24bfbad927a4bfd71edd09)
(cherry picked from commit bf77686ba9d6707aaf3ec594b447e39fbcecf5b4)
Branch: v4.4
https://github.com/mongodb/mongo/commit/7c597033c38da941b849393c6a373fb3db61f65a

Comment by Githook User [ 25/Mar/23 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-74845 Add environment variable override for processManagement.fork

(cherry picked from commit 7a722b6621d900e9f9a81fdea27160104dce2055)
(cherry picked from commit 965012e67dca663c5a24bfbad927a4bfd71edd09)
Branch: v5.0
https://github.com/mongodb/mongo/commit/bf77686ba9d6707aaf3ec594b447e39fbcecf5b4

Comment by Githook User [ 25/Mar/23 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-74845 Override processManagement.fork in mongod.service

(cherry picked from commit 26b4106ddaac866c5b4b9f630e462fd7c7e9b53d)
(cherry picked from commit 7ee56cd76001be3efdb42bad292d83ea062b6aaf)
Branch: v5.0
https://github.com/mongodb/mongo/commit/902f12d4af4d7b9ba4f813c4e351f69cfa19561d

Comment by Githook User [ 24/Mar/23 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-74845 Add environment variable override for processManagement.fork

(cherry picked from commit 7a722b6621d900e9f9a81fdea27160104dce2055)
Branch: v6.0
https://github.com/mongodb/mongo/commit/965012e67dca663c5a24bfbad927a4bfd71edd09

Comment by Githook User [ 24/Mar/23 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-74845 Override processManagement.fork in mongod.service

(cherry picked from commit 26b4106ddaac866c5b4b9f630e462fd7c7e9b53d)
Branch: v6.0
https://github.com/mongodb/mongo/commit/7ee56cd76001be3efdb42bad292d83ea062b6aaf

Comment by Githook User [ 23/Mar/23 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-74845 Add environment variable override for processManagement.fork
Branch: master
https://github.com/mongodb/mongo/commit/7a722b6621d900e9f9a81fdea27160104dce2055

Comment by Githook User [ 23/Mar/23 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-74845 Override processManagement.fork in mongod.service
Branch: master
https://github.com/mongodb/mongo/commit/26b4106ddaac866c5b4b9f630e462fd7c7e9b53d

Comment by Ryan Egesdahl (Inactive) [ 23/Mar/23 ]

For later archaeologists, what we went with is an environment variable which causes processManagement.fork to be false regardless of what's in mongod.conf. The environment variable is set in mongod.service distributed in our packages, so anyone using our packages will always get a non-forking process.

Comment by Billy Donahue [ 15/Mar/23 ]

Update: this didn't turn out to be the case:

> That is, a --fork would be synonymous with --fork=true

A "Bool" type needs an argument. You can't just give it without one.
But we can introduce a "nofork" option. I'll try that next.

Comment by Billy Donahue [ 15/Mar/23 ]

New idea: Change --fork from a "Switch" type to a "Bool" type.
I believe it would retain backward compatibility.

That is, a --fork would be synonymous with --fork=true, but we'd gain the ability to say --fork=false on the command line, and the command line overrides the config file by design!

So 1-line change at that point. Verifying all of this.

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