AWS Thinkbox Discussion Forums

strange mongodb warning

Hey guys,

We were adding another replica set member today, and it popped this error while syncing:

2015-04-22T18:45:09.418-0700 [initandlisten] WARNING: the collection ‘deadline7db_Statistics.SlaveStatistics’ lacks a unique index on _ id. This index is needed for replication to function properly
2015-04-22T18:45:09.418-0700 [initandlisten] To fix this, you need to create a unique index on _id. See dochub.mongodb.org/c ore/build-replica-set-indexes

Not sure if that’s ok?

It could be that something went wrong during the sync? I noticed that it restarted the sync for that db at one point.

Were you eventually able to get the replica set setup properly? Maybe it was a glitch in the process that MongoDB recovered from…

The replica set synced up properly (or at least according to mongodb :slight_smile: ), but when i start a mongo shell, i still get the warning:

mongo

MongoDB shell version: 2.6.9
connecting to: test
Server has startup warnings:
2015-04-22T18:45:09.418-0700 [initandlisten] WARNING: the collection ‘deadline7db_Statistics.SlaveStatistics’ lacks a unique index on _id. This index is needed for replication to function properly
2015-04-22T18:45:09.418-0700 [initandlisten] To fix this, you need to create a unique index on _id. See dochub.mongodb.org/core/build-re … et-indexes

Does that collection have a unique index? Should we try to wipe & resync the db?

It seems like after restarting the mongo server, the warning is now gone! So no worries, must have been a syncing glitch that simply left a startup warning that never got cleared.

Ah, cool. :slight_smile:

Privacy | Site terms | Cookie preferences