[SERVER-22434] Running repairDatabase on non-existing database creates an empty db folder on filesystem Created: 02/Feb/16  Updated: 03/Jan/18  Resolved: 21/Nov/16

Status: Closed
Project: Core Server
Component/s: MMAPv1, Storage
Affects Version/s: 2.6.11
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Dinesh Chander Assignee: Daniel Gottlieb (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-23976 repairDatabase command on a new, diff... Closed
Related
Operating System: ALL
Participants:
Case:

 Description   

Running repairDatabase on a non-existing database creates an empty db folder on the filesystem but show dbs does not show the same on the shell.

dineshs-MacBook-Pro:db dineshchander$ ls -lrt
total 163848
-rwxr-xr-x  1 dineshchander  staff         6 Feb  2 21:48 mongod.lock
drwxr-xr-x  3 dineshchander  staff       102 Feb  2 21:48 journal
-rw-------  1 dineshchander  staff  16777216 Feb  2 21:48 local.ns
-rw-------  1 dineshchander  staff  67108864 Feb  2 21:48 local.0
drwxr-xr-x  2 dineshchander  staff        68 Feb  2 21:48 _tmp
dineshs-MacBook-Pro:db dineshchander$ mongo
MongoDB shell version: 2.6.11
connecting to: test
Server has startup warnings: 
2016-02-02T21:48:07.971+0530 [initandlisten] 
> db.version()
2.6.11
> use abcd
switched to db abcd
> db.repairDatabase()
{ "ok" : 1 }
> show dbs
admin  (empty)
local  0.078GB
> ^C
bye
dineshs-MacBook-Pro:db dineshchander$ ls -lrt
total 163848
-rwxr-xr-x  1 dineshchander  staff         6 Feb  2 21:48 mongod.lock
drwxr-xr-x  2 dineshchander  staff        68 Feb  2 21:48 _tmp
drwxr-xr-x  2 dineshchander  staff        68 Feb  2 21:48 journal
drwxr-xr-x  2 dineshchander  staff        68 Feb  2 21:48 abcd
-rw-------  1 dineshchander  staff  16777216 Feb  2 21:48 local.ns
-rw-------  1 dineshchander  staff  67108864 Feb  2 21:48 local.0

As the db is non-existing (even the shell does not show it), no directory should get created on the filesystem.



 Comments   
Comment by Daniel Gottlieb (Inactive) [ 21/Nov/16 ]

As milkie mentioned, I verified this has gone away with SERVER-23976.

Comment by Eric Milkie [ 16/Nov/16 ]

The fix for SERVER-23976 will end up fixing this as well; we will no longer create empty databases on MMAPv1.

Generated at Thu Feb 08 04:00:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.