[SERVER-16677] mongod.lock file should be present in data directory regardless of storage engine selected Created: 28/Dec/14  Updated: 10/Feb/15  Resolved: 05/Jan/15

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.8.0-rc4
Fix Version/s: 2.8.0-rc5

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: 28qa, wiredtiger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-16781 Starting mongod with wiredtiger stora... Closed
Related
related to SERVER-17210 Crash can leave data inaccessible due... Closed
Backwards Compatibility: Fully Compatible
Operating System: Linux
Participants:
Linked BF Score: 0

 Description   

Currently, mongod.lock is created in the data directory by the mmapv1 initialization code and is not present when another storage engine (eg. WiredTiger) is selected.

We should always ensure that this file is created (and locked) regardless of the storage engine used.

----------
The --shutdown switch (Linux-specific) doesn't work with WiredTiger because the --shutdown code checks for a non-existent mongod.lock file:

https://github.com/mongodb/mongo/blob/b0014456ddefaccf02016c1a89c514e865a099d6/src/mongo/db/db.cpp#L722-L729

$ ./mongod --storageEngine=wiredTiger --fork --logpath=foo.log
about to fork child process, waiting until server is ready for connections.
forked process: 3680
child process started successfully, parent exiting
 
$ ./mongod --shutdown
There doesn't seem to be a server running with dbpath: /data/db


Version: b0014456dd



 Comments   
Comment by Githook User [ 09/Jan/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-16677 added warning message to WiredTiger initialization on detecting unclean shutdown
Branch: master
https://github.com/mongodb/mongo/commit/3b07deccd9ab61e4f515677abf420aff01984a37

Comment by Githook User [ 05/Jan/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-16677 moved management of mongod.lock from mmapv1 engine to global environment
added test to ensure that mongod.lock is created for all storage engines/platforms.
Branch: master
https://github.com/mongodb/mongo/commit/d602ceb25e996962298ab45864aad4eb80262485

Comment by Githook User [ 05/Jan/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-16677 added unclean shutdown warning to global environment
extended storage engine factory to accept lock file information.
Branch: master
https://github.com/mongodb/mongo/commit/2f881f7f2a00bb4b5f7af868033b89b1246e8bc8

Comment by Githook User [ 05/Jan/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-16677 added platform-dependent class to management creation/locking of mongod.lock in data directory.
Branch: master
https://github.com/mongodb/mongo/commit/d9ce31ea2237d4aa78656fed785e7e5b91c93843

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