I noticed on my sharded collection called 'col' that db.col.count() does not return the actual number of documents (found by using the aggregation framework).
According to the MongoDB docs:
On a sharded cluster, db.collection.count() can result in an inaccurate count if orphaned documents exist or if a chunk migration is in progress.
I am trying to follow the instructions for cleaning up orphans:
db.runCommand( {
cleanupOrphaned: "my_database.col",
} )
However, the command has been running for a long time. Looking at the mongoDB logs on any of the shards, I see:
2014-11-07T15:33:49.737-0500 [conn862] rangeDeleter waiting for open cursors in: my_database.col, min: { _id: MinKey }, max: { _id: -8172160724588201855 }, cursors: [ 91955293283 ]
What could be the cause of these waiting for open cursors messages and how do I fix it?