[DOCS-1493] Warn user about enabling --directoryperdb with existing databases Created: 08/May/13  Updated: 08/May/13  Resolved: 08/May/13

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Stephen Lee Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 10 years, 41 weeks ago

 Description   

TBH, I'm not sure if the following is by design, but at minimum, it needs some warning/clarification in the documentation. Mixing databases created without '--directoryperdb' and databases created with '--directoryperdb' does not work.

If a user has an existing mongod running w/o '--directoryperdb' but restarts w/ it enabled, old databases will no longer be addressable. For example, before enabling '--directoryperdb', my dbpath looks something like:

drwxr-xr-x   2 slee  wheel         68 May  8 09:41 journal
-rwxr-xr-x   1 slee  wheel          5 May  8 09:41 mongod.lock
-rw-------   1 slee  wheel   67108864 May  7 13:47 test.0
-rw-------   1 slee  wheel  134217728 May  7 13:26 test.1
-rw-------   1 slee  wheel   16777216 May  7 13:44 test.ns

Subsequently, I enable '--directoryperdb' but when I query for anything inside of the test database, mongod expects to find test's data files organized in the following fashion.

drwxr-xr-x   2 slee  wheel         68 May  8 09:41 journal
-rwxr-xr-x   1 slee  wheel          5 May  8 09:41 mongod.lock
-rw-------   1 slee  wheel   67108864 May  7 13:47 test/test.0
-rw-------   1 slee  wheel  134217728 May  7 13:26 test/test.1
-rw-------   1 slee  wheel   16777216 May  7 13:44 test/test.ns

Stopping mongod, moving the test data files into a 'test' subdirectory of the dbpath root, and starting mongod --directoryperdb seems to work (w/o any deeper testing...); I can address the test database again.

This is an important distinction because a user could want to use '--directoryperdb' to take advantage of a dbpath spanning multiple disks, but the user should be aware of having to potentially migrate existing databases before enabling '--directoryperdb'.



 Comments   
Comment by auto [ 08/May/13 ]

Author:

{u'date': u'2013-05-08T15:57:18Z', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-1493 note about moving to directoryperdb
Branch: v2.2
https://github.com/mongodb/docs/commit/2dd3324422c756ad491c0e1df32c1e8806dcd847

Comment by auto [ 08/May/13 ]

Author:

{u'date': u'2013-05-08T15:57:18Z', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-1493 note about moving to directoryperdb
Branch: master
https://github.com/mongodb/docs/commit/c93be4ab9fbec1448ecb3a7b0a71605b0eb71ded

Generated at Thu Feb 08 07:41:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.