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

Cannot toggle directoryperdb on mmapv1

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • Labels:
    • Fully Compatible
    • ALL

      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") }
      

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

              Created:
              Updated:
              Resolved: