Does cleanupOrphaned Command work on hash based sharding?

31 views
Skip to first unread message

Joe Waller

unread,
Jan 12, 2017, 8:46:37 PM1/12/17
to mongodb-user
Hi,

I have a collection that is using hash based sharding on the _id command. I have detected duplicate documents by connecting directly to the shards. Can I use cleanupOrphaned command to clean up the duplicates when i using hash bashed sharding? Does this command know to compute the hash of _id before it compares to the chunk ranges?

thanks,
Joe

Joe Waller

unread,
Jan 17, 2017, 1:58:36 PM1/17/17
to mongodb-user
Hi folks,

Can someone from the mongodb team confirm that is ok to use this command on hash sharded collections?

Samantha Ritter

unread,
Jan 23, 2017, 11:14:22 PM1/23/17
to mongodb-user
Hi Joe,

Yes, it should be fine to use the cleanupOrphaned command with hashed shard keys. This is a case that we test for, if you're curious you can see the test here: https://github.com/mongodb/mongo/blob/master/jstests/sharding/cleanup_orphaned_cmd_hashed.js

Thanks,
Sam
Reply all
Reply to author
Forward
0 new messages