Index on _id got missed

44 views
Skip to first unread message

aayushi...@gmail.com

unread,
Sep 12, 2017, 11:17:24 PM9/12/17
to mongodb-user
Mongodb version -3.2.6
 We have a replica set environment with 5 members includes 1 delayed, 1 hidden, 1 primary, and 2 secondaries.
 On primary node we got this message:
 2017-07-05T18:53:08.800Z I STORAGE  [initandlisten] WARNING: the collection 'ns' lacks a unique index on _id. This index is needed for replication to function properly.
 After got this message when we have checked in secondary node indexed were proper .
 So we are wondering:
 1) _id index is mendatory and created automatically. So is there any scenario where index got removed
 2) and if index got removed then it should synced in secondary too.

Wan Bachtiar

unread,
Sep 18, 2017, 11:02:14 PM9/18/17
to mongodb-user

1) _id index is mendatory and created automatically. So is there any scenario where index got removed

Hi,

Generally the warning message(s) above is triggered on a replica set member restart. A startup check process would discover that some collections exist without _id index, which would then reset the Initial Sync process.

A possible scenario is when a replica set member was terminated during the synchronisation of the oplog but before the index building stage.

if index got removed then it should synced in secondary too.

It is likely that the primary would have been vetoed and a new primary would have been elected. You should analyse your replica set members logs to get a better picture of the events.

Also I would recommend to use the latest stable release of MongoDB for bug fixes and enhancements. For MongoDB v3.2.x currently it is v3.2.16. See also Upgrade to the latest revision of MongoDB.

Regards,
Wan.

Reply all
Reply to author
Forward
0 new messages