-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.4.5
-
Component/s: None
-
None
-
Catalog and Routing
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
Currently it is not possible to invoke a removeShard command on a specific machine and add it again at a later time without removing the datafiles due to the following error :
"errmsg" : "can't add shard localhost:27022 because a local database 'test' exists in another shard0000:localhost:27021"
I understand mongo cannot simply remove the database from the removed shard for a variety of reasons but I think the validation step to determine if the shard to be added is "clean" can be improved. I would assume iterating over all partitioned = true database on the new shard and for each iterating on all sharded collections to check if they're empty should be as safe a check and would allow subsequent removeShard->addShard without further intervention.