-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.1.0
-
Component/s: Sharding
-
None
-
Sharding
If a drop database fails on some of the shards (for example, when one of the shards was temporarily unreachable), the chunk collection does not get cleaned up properly. The error message does not indicate which of the shards were successfully dropped either:
{ "errmsg" : "exception: socket exception", "code" : 11002, "ok" : 0 }
This will create a state where some of the shards still have the collection while others don't. Currently, mongos will stop right away and will not try proceeding to dropping the database on other shards. If the unreachable shard gets back again and you re-enable sharding + shard the collection, mongos would complain that the collection is already sharded. And querying stuff the belongs to the previously downed shards would give you the correct result.
Proposal:
Give user more useful feedback on which shards where able to successfully drop (or unsuccessful) so the user can have the necessary information in the case he/she wants to intervene manually.
Also consider cleaning the config information if at least one of the shards was able to successfully perform the drop.
- duplicates
-
SERVER-17397 Dropping a Database or Collection in a Sharded Cluster may not fully succeed
- Closed
- is depended on by
-
SERVER-5126 db.dropDatabase() fails in sharded environment
- Closed
- is duplicated by
-
SERVER-6751 db.dropDatabase() on a sharded database causes only one shard to be cleared
- Closed