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

Cannot toggle directoryperdb on mmapv1

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Storage
    • Fully Compatible
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: