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

Cannot create a capped collection larger than 536608767 bytes on 32-bit systems

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0.6
    • Component/s: Storage
    • Labels:
      None
    • Environment:
      Ubuntu 12.04 - 32 bit & MongoDB v2.06.
      Windows W2k8 -32 bit &MongoDB v2.06.
    • Storage Execution
    • ALL

      32-bit versions have --smallfiles set, and this limits the maximum
      size of any of the components files of a database.

      The assertion being hit seems to be fixed in versions before 2.0.5 (as mentioned here) where the assertion was that the requested extent size was less than the maximum allowed, rather than less than or equal to the maximum. This was fixed here.

      A 512 MB file is created, so we haven't run out of virtual address space yet, but nothing bigger than 512mb can be created.

      Simple to reproduce:

      Run mongod on 32-bit system.
      Connect to mongo shell.
      Open a database.
      Run the following commands -

      db.createCollection("my13", {capped:true, size:536608768})
      

      and receive the following error

      {
      	"errmsg" : "exception: assertion db/pdfile.cpp:437",
      	"code" : 0,
      	"ok" : 0
      }
      

      whereas the following is ok

      db.createCollection("my13", {capped:true, size:536608767})
      { "ok" : 1 }
      

      I tried to reproduce on a x64 system with "--smallfiles", however, was unable to reproduce.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            mark Mark porter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: