Reputation: 19
We has a MongoDB Shard configured with 4 shards (A,B,C,D). Shard D was added after A,B,C. Some collections correctly balance with D but just one collection has some problem with migration.
On D logs show this message all time.
W SHARDING [migrateThread] Cannot receive chunk [{ _id: ObjectId('5ad5586b7ee7821b48139cfb') }, { _id: ObjectId('5ad6d2d77ee78222283cc9d5') }) for collection products because we already have an identically named collection with UUID c16daf18-9412-437b-a1ba-a9e000e694ac, which differs from the donor's UUID 25a21963-d9ba-4022-becc-648d4d39a68c. Manually drop the collection on this shard if it contains data from a previous incarnation of products.
I understand the error, but I don't know how do that. If I go to mongos and use status(), the collection products not show on shard D, but on logs says the contrary. I don't know, if I connect on shard D and run db.products.drop(), this action delete just on D or in all shard?
Upvotes: 1
Views: 546
Reputation: 410
Yes, you need to connect directly to shard D and drop the collection there, which will NOT drop if from the other shards. Then when the balancer runs again, the balancer will be able to create the collection itself. Somehow the collection was there on the replica set before it was added as a shard. (You also might want to do a mongodump
directly from the shard replica set (not the mongos
), just in case there is data you want there.
Upvotes: 1