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

Cannot toggle directoryperdb on mmapv1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Storage
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      As of SERVER-16567, inconsistent use of --directoryperdb across restarts will result in a startup error.

      ------

      Creating databases and changing the value of directoryperdb will result in the databases disappearing on mmapv1.

      Below are the cases tested. The database directory was purged between cases.

      With mmapv1, going from off to on:

      sajack@linux /home/sajack/mongo git CAP-1809 () % ./mongod --dbpath db1                                               :)
       
      > use db1
      switched to db db1
      > db.col.insert({})
      WriteResult({ "nInserted" : 1 })
      > db.col.find()
      { "_id" : ObjectId("54aeb9204761b53949029dd8") }
      > 
      bye
       
      sajack@linux /home/sajack/mongo git CAP-1809 () % ./mongod --dbpath db1 --directoryperdb                              :)
       
      > use db1
      switched to db db1
      > db.col.find()
      > show dbs
      local  0.078GB

      With mmapv1, going from on to off:

      sajack@linux /home/sajack/mongo git CAP-1809 () % ./mongod --dbpath db1 --directoryperdb
       
      > use db
      switched to db db
      > db.col.insert({})
      WriteResult({ "nInserted" : 1 })
      > db.col.find()
      { "_id" : ObjectId("54aeb9f222d567992071dbeb") }
      > 
      bye
       
      > use db
      switched to db db
      > db.col.find()
      > show dbs
      local  0.078GB

      For reference, WiredTiger works correctly as follows:

      With wiredTiger, going from off to on:

      sajack@linux /home/sajack/mongo git CAP-1809 () % ./mongod --storageEngine wiredTiger --dbpath db1
       
      > use db
      switched to db db
      > db.col.insert({})
      WriteResult({ "nInserted" : 1 })
      > db.col.find()
      { "_id" : ObjectId("54aeba967c5aedfd996ccc01") }
      > ^C
      bye
       
      sajack@linux /home/sajack/mongo git CAP-1809 () % ./mongod --storageEngine wiredTiger --dbpath db1 --directoryperdb
       
      > use db
      switched to db db
      > db.col.find()
      { "_id" : ObjectId("54aeba967c5aedfd996ccc01") }

      With wiredTiger, going from on to off:

      sajack@linux /home/sajack/mongo git CAP-1809 () % ./mongod --storageEngine wiredTiger --dbpath db1 --directoryperdb
       
      > use db
      switched to db db
      > db.col.insert({})
      WriteResult({ "nInserted" : 1 })
      > db.col.find()
      { "_id" : ObjectId("54aebb5bf3a2237c97e8594b") }
      > ^C
      bye
       
      ./mongod --storageEngine wiredTiger --dbpath db1
       
      > use db
      switched to db db
      > db.col.find()
      { "_id" : ObjectId("54aebb5bf3a2237c97e8594b") }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              benety.goh Benety Goh
              Reporter:
              spencer.jackson Spencer Jackson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: