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") }
- is related to
-
SERVER-16567 extend data directory metadata to hold storage engine creation settings for startup validation
-
- Closed
-