[DOCS-3972] Better document --shutdown (Don't say we use it in control scripts) Created: 02/Sep/14 Updated: 16/Mar/15 Resolved: 09/Sep/14 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual |
| Affects Version/s: | None |
| Fix Version/s: | v1.3.11 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Scott Nichol | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 9 years, 23 weeks, 1 day ago |
| Description |
|
The mongod docs say of the --shutdown flag: "Used in control scripts, the --shutdown option cleanly and safely terminates the mongod process." Unfortunately, the control scripts that are provided with mongod do not use this product feature, but instead execute the platform-typical kill. Examples of such scripts are https://github.com/mongodb/mongo/blob/master/rpm/init.d-mongod and https://github.com/mongodb/mongo/blob/master/debian/init.d. If the control scripts do not use --shutdown because kill -TERM is just as safe and clean, then either the --shutdown docs should say so or the --shutdown option should be removed altogether. |
| Comments |
| Comment by Githook User [ 09/Sep/14 ] |
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: |
| Comment by Ernie Hershey [ 02/Sep/14 ] |
|
Good catches, snichol! I removed the FIXME which I think is far out of date now. I also moved this to the DOCS project and agree we should be clearer about it in the docs. |
| Comment by Githook User [ 02/Sep/14 ] |
|
Author: {u'username': u'ehershey', u'name': u'Ernie Hershey', u'email': u'ernie.hershey@10gen.com'}Message: |
| Comment by Scott Nichol [ 02/Sep/14 ] |
|
OK, I did a little more research that I probably should have done before creating this ticket. The code in https://github.com/mongodb/mongo/blob/master/src/mongo/db/db.cpp that implements --shutdown ultimately does a kill(pid, SIGTERM), so the killing done in the control scripts leads to "safe and clean" shutdown. The real difference of --shutdown is that it will use the lock file in dbpath to get the pid, rather than the mechanism the control script has for tracking the pid. This behavior is presumably by design. The documentation for --shutdown should be clear about the difference between this option and the behavior of the control scripts included in the distro, and the FIXME comment in https://github.com/mongodb/mongo/blob/master/rpm/init.d-mongod should make it clear that not using --shutdown creates no "cleanliness" problem (or maybe remove the FIXME?). |