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

Creating too large of a collection leads to file allocation failure exception that it cannot recover from

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.6.5
    • Component/s: MMAPv1, Storage
    • None
    • Storage Execution
    • ALL

      If the drive only has 20GB and you try to create a 40GB capped collection, for example, named 'people', MongoDB will fail with the following error:

      {
      "errmsg" : "exception: file allocation failure",
      "code" : 12520,
      "ok" : 0
      }

      However the disk space is never cleaned up. So I cannot go back in and say allocate a 18GB capped collection now that I know it was too large. MongoDB should 'undo' on this sort of file allocation error so you can correct the information without running db.repairDatabase(). Also the system.namespaces collection thinks the database was created so your unable to reuse the same name (even though the attempt failed) and I cannot call db.people.drop() as it says it doesnt exist.

      You end up with a very inconsistant state where it is unclear what it would end up with even after running repairDatabase or validate.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            jsmestad Justin Smestad
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: