Question

I was attempting to reduce the size of my indexes on a mongo collection and ran db.collection.reIndex().

After about 90 minutes, I began to think it had somehow gotten locked up and tried to cancel. Now (about 2 hours after cancelling) the collection appears to be locked to all write commands. All my other collections are allowing writes. Is there any way to unlock it?

Was it helpful?

Solution

The period of time that it takes to perform this operation is going is dependent on a few things, namely:

  1. The size of the collection.
  2. The number of indexes in that collection.

This is a blocking operation.

Simply put, a small database (less than 500MB) should only take a few minutes to reindex whereas a larger database (5-10GB or more) could take much longer ... with increasing length as the database size increases.

While it is best to let the procedure finish, if you absolutely needed to stop it, then restarting the process would be the way to do it. Also, send in a support ticket to: support@mongohq.com (including the name of the database) and the team can help more there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top