[SERVER-5304] initial sync fails to create index on capped collection Created: 14/Mar/12  Updated: 11/Jul/16  Resolved: 03/Jun/12

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Replication
Affects Version/s: 2.0.3
Fix Version/s: 2.1.2

Type: Bug Priority: Major - P3
Reporter: igor serebryany Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: capped_collection
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ubuntu 10.04 base install using the mongo upstart repo


Issue Links:
Depends
Related
is related to SERVER-6577 capped collection _id index creation ... Closed
is related to SERVER-5516 Capped collections (tracking ticket) Closed
Operating System: ALL
Participants:

 Description   

1) create a db with a capped collection
2) make sure the capped collection has an index on _id
3) add a new, empty member into the replica set containing the capped collection

after initial replication is over and the new member goes into RECOVERING, the index on the capped collection is not created. this causes oplog applies to be really really slow:

Wed Mar 14 03:17:07 [rsSync] replSet initial oplog application from mongo3.thedomain.net:27017 starting at Mar 14 01:18:02:2 to Mar 14 03:16:56:3
Wed Mar 14 03:29:26 [rsSync] replSet initialSyncOplogApplication applied 1000 operations, synced to Mar 14 01:18:17:3
Wed Mar 14 03:54:09 [rsSync] replSet initialSyncOplogApplication applied 2000 operations, synced to Mar 14 01:18:54:1

the workaround of removing the new member from the replica set by omitting it's --replSet, manually running ensureIndex and then re-starting the new member back inside the replica set seems to do the trick. recovery then completes rapidly. this might also work with other indexes besides '_id' – haven't tested.

see this thread:https://groups.google.com/d/topic/mongodb-user/oU66dwiRR4w/discussion



 Comments   
Comment by auto [ 02/Aug/12 ]

Author:

{u'date': u'2012-08-02T05:14:22-07:00', u'email': u'matulef@gmail.com', u'name': u'Kevin Matulef'}

Message: SERVER-5516 SERVER-5304 SERVER-6577 new capped collections now get _id index by default (except in local db)
Branch: master
https://github.com/mongodb/mongo/commit/b202965c2aa985232699b059c7135dd64f09700e

Comment by auto [ 24/Jul/12 ]

Author:

{u'date': u'2012-07-24T09:02:39-07:00', u'email': u'matulef@10gen.com', u'name': u'Kevin Matulef'}

Message: SERVER-5304 test capped colls get _id index on secondaries
Branch: master
https://github.com/mongodb/mongo/commit/e91b8eab100133b40a9f0cc2a790fcfbfa925fe8

Comment by auto [ 03/Jun/12 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: SERVER-5304 SERVER-5649 - always create _id indexes on capped collections on secondaries
Branch: master
https://github.com/mongodb/mongo/commit/0578c56f6bfb592ce56c7518a6fd7d25b82e6851

Generated at Thu Feb 08 03:08:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.