Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12921

mongorestore-2.6 doesn't remove it's own PID file when restoring auth data with --dbpath

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.0-rc1
    • Affects Version/s: 2.6.0-rc0
    • Component/s: None
    • None
    • Fully Compatible
    • ALL

      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| *************
      

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            mikeo@mongodb.com Michael O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: