Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-3288

Documents in Capped Collections should not be modified

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • v1.3.7
    • Affects Version/s: mongodb-2.6
    • Component/s: manual
    • Labels:
      None

      http://docs.mongodb.org/manual/core/capped-collections/#recommendations-and-restrictions


      You can update documents in a collection after inserting them. However, these updates cannot cause the documents to grow. If the update operation causes the document to grow beyond their original size, the update operation will fail.

      See SERVER-6984

      If a document in a capped collection is updated to be smaller, and then a secondary is re-sync'ed from it, the secondary will replicate (and allocate) based on the current smaller size. If the primary then receives an update which grows the document back to the original size (perfectly safe according to the above quote), the primary will accept the update, but the secondary will die with a fatal assertion.

      A document in a capped collection which was shrunk from it's original size is a landmine.

      We should give a warning about this problem. See SERVER-6984 and Thomas' nifty flowchart for details on how it occurs.

            Assignee:
            tim.slavin Tim Slavin
            Reporter:
            andrew.ryder@mongodb.com Andrew Ryder (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              9 years, 45 weeks ago