[SERVER-5521] Better user feedback when drop command was not executed successfully on all shards Created: 05/Apr/12  Updated: 06/Dec/22  Resolved: 03/May/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.1.0
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Randolph Tan Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-5126 db.dropDatabase() fails in sharded en... Closed
Duplicate
duplicates SERVER-17397 Dropping a Database or Collection in ... Closed
is duplicated by SERVER-6751 db.dropDatabase() on a sharded databa... Closed
Assigned Teams:
Sharding
Participants:

 Description   

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.



 Comments   
Comment by Kaloian Manassiev [ 03/May/18 ]

Closing as duplicate of SERVER-17397, which is about implementing a more solid solution.

Comment by Kay Agahd [ 22/Jul/15 ]

Even if all shards are reachable, db.dropDatabase() executed through mongos is not able to remove the database from all shards (tested on mongdb v3.0.2).

Generated at Thu Feb 08 03:09:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.