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.
- depends on
-
SERVER-6984 Initial sync can fail, or break future replication, when updates shrink or grow docs in capped collections
- Closed