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

Documents in Capped Collections should not be modified

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: mongodb-2.6
    • Fix Version/s: v1.3.7
    • Component/s: manual
    • Labels:
      None
    • Last comment by Customer:
      true
    • Actual Time:
      4

      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

              Assignee:
              tim.slavin Tim Slavin
              Reporter:
              andrew.ryder Andrew Ryder (Inactive)
              Participants:
              Last commenter:
              Jonathan Dahl Jonathan Dahl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved:
                Days since reply:
                7 years, 18 weeks, 6 days ago
                Date of 1st Reply: