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

Documents in Capped Collections should not be modified

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • mongodb-2.6
    • v1.3.7
    • manual
    • None
    • 4
    • true

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                8 years, 16 weeks, 5 days ago