Inconsistent index in replica set

59 views
Skip to first unread message

Daniel

unread,
Sep 24, 2012, 5:15:47 AM9/24/12
to mongod...@googlegroups.com
Hi,

i have 3 shards with with 3 members in each replica set. I have dropped via mongos an index, but
now recognized, that this index still exist on one member in a replica set. And i also can't set this
member to be the PRIMARY, so i can't drop it directly. 
Is there a way to send the drop Index command from a PRIMARY in the set which does not have the
index anymore to all the other members in the set?

Thanks & regards

Daniel

Jason Rassi

unread,
Sep 24, 2012, 11:15:46 AM9/24/12
to mongodb-user
No, functionality does not exist to automatically run a command on all
replica set members.

Instead, for each replica set member, connect to it directly with the
mongo shell (that is, don't connect to mongos) and drop the index.

Daniel

unread,
Sep 26, 2012, 4:32:03 AM9/26/12
to mongod...@googlegroups.com
Yes, that's what I tried. But dropping index was only possible on the PRIMARY and the stepDown didn't work.

But the server crashed and lost it's entire data anyway. So it became a brand new member. ;)

Thanks

Prashanth Kokati

unread,
Nov 11, 2013, 5:13:16 PM11/11/13
to mongod...@googlegroups.com
We have had the similar issue. The way we tried to do is, pull the secondary where the index need to be dropped out of the replicaset. Bring it up on a seperate port and drop the index. Make sure at that time, the PRIMARY at that time does not have that index that you are dropping on this node. If so, shutdown the PRIMARY and bring back this node into the replicaset and then bring back dropped PRIMARY (if you have dropped it, for this to work).

Asya Kamsky

unread,
Nov 14, 2013, 3:55:41 AM11/14/13
to mongodb-user
I missed this conversation the first time, but I don't see how it's possible that dropIndex on the primary would NOT replicate to secondaries.   Indexes are documents stored in the oplog just like other change operations.  Removing a document from system.indexes collection should create a change record for the oplog the same as when you create an index.  It will then replicate to secondaries.  If that's not how it's working for you then that sounds like a bug that should be fixed.

Note that this is different than asking about running a command on all members of the replica set - ensureIndex and dropIndex are special "commands" in that they result in a document being inserted or removed from a collection.

Asya



--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages