[SERVER-12921] mongorestore-2.6 doesn't remove it's own PID file when restoring auth data with --dbpath Created: 26/Feb/14  Updated: 11/Jul/16  Resolved: 28/Feb/14

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.6.0-rc0
Fix Version/s: 2.6.0-rc1

Type: Bug Priority: Major - P3
Reporter: Michael O'Brien Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

to reproduce:
start a 2.4 mongod (source), insert a bunch of users with addUser.

start a 2.6 mongod (target), insert one test user with createUser.

shut down both mongod's.

dump the source database using mongodump --dbpath <source dbpath>.
restore it into the target database using mongorestore-2.6 --dbpath <target dbpath>.

It will print this error and then exit, which seems fine/normal:

Restoring to admin.system.users without dropping. Restored data will be inserted without raising errors; check your server log
Server has authorization schema version 3, but found a schema version 1 user: { _id: ObjectId('530e5146c7fc46d67a0beab8'), user: "user", pwd: "58a5ef6a66ff3b073530259153e94ae2", roles: [ "readWriteAnyDatabase" ] }

However, after exiting, a non-empty mongod.lock file is left behind by mongorestore.
When trying to start the target mongod again, it fails:

 m50102| **************
 m50102| old lock file: /data/db/mongod-50102/mongod.lock.  probably means unclean shutdown,
 m50102| but there are no journal files to recover.
 m50102| this is likely human error or filesystem corruption.
 m50102| please make sure that your journal directory is mounted.
 m50102| found 2 dbs.
 m50102| see: http://dochub.mongodb.org/core/repair for more information
 m50102| *************



 Comments   
Comment by Githook User [ 28/Feb/14 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-12921 Make sure mongorestore runs cleanup routines on error
Branch: master
https://github.com/mongodb/mongo/commit/5f4dfa51a90066547f4856b8cff6096870b29810

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