[DOCS-362] New replication behavior for capped collections needs to be documented. Created: 24/Jul/12  Updated: 08/Sep/12  Resolved: 07/Aug/12

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: mongodb-2.2

Type: Bug Priority: Major - P3
Reporter: Kevin Matulef Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:
Days since reply: 11 years, 28 weeks ago

 Description   

The replication behavior of capped collections has changed. By default, capped collections do not have an _id index. Prior to 2.2, this caused replication of capped collections to be very slow, until the user created the _id index themselves. In 2.2, the _id index is still not created by default on the primary, but it is created on the secondaries after some number of insert or updates. This prevents replication from falling behind. We still recommend that users create the _id index manually on the primary, so that if the primary node fails over and becomes a secondary, it will already have an _id index.



 Comments   
Comment by auto [ 08/Aug/12 ]

Author:

{u'date': u'2012-08-08T06:08:39-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: DOCS-362 correcting capped collections _id index
Branch: master
https://github.com/mongodb/docs/commit/5e0e56eaf4d4297d3f03d84b41ba7aeeb1de4003

Comment by Kevin Matulef [ 08/Aug/12 ]

Sam, sorry I didn't clarify this earlier: when we changed the capped collection defaults, we also reverted the previous change that built indexes on the secondaries. It's no longer the case that the _id index will be built on the secondary and not the primary. The set of indexes should be the same on both.

Basically, for any capped collections that you've created prior to 2.2, nothing has changed. Replication will still be slow for them, until you manually create the _id index (it's recommended to do this on secondaries first, then the primary). For any capped collection that you create after 2.2 (except those in the "local" database), they'll have the _id index by default, and replication will work fine for them.

Comment by auto [ 07/Aug/12 ]

Author:

{u'date': u'2012-08-07T16:09:45-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: DOCS-362 capped collections behavior clarification
Branch: master
https://github.com/mongodb/docs/commit/b115e348b973e72357a0b7c94a16fe1a1f4591dd

Comment by auto [ 07/Aug/12 ]

Author:

{u'date': u'2012-08-07T15:51:44-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: DOCS-362 capped collections _id behavior change for 2.2
Branch: master
https://github.com/mongodb/docs/commit/bf5e68acbc9c528763ebd15861652b59bd4da801

Generated at Thu Feb 08 07:38:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.