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

Running repairDatabase on non-existing database creates an empty db folder on filesystem

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 2.6.11
    • Component/s: MMAPv1, Storage
    • None
    • ALL

      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.

            Assignee:
            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            Reporter:
            dinesh.chander@mongodb.com Dinesh Chander
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: