Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9496

Drop sharded collection the drop of sharded db leaves data on non-primary shards

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Assuming 2+ shards

      Repro Steps:

      sh.enableSharding("foo");
      sh.shardCollection("foo.bar", {x:1});
      for(i=0;i<500000;i++){db.getSiblingDB("foo").bar.insert({x:i});}
      //For Migrations
      sleep(60);
      db.getSiblingDB("foo").bar.drop();
      db.getSiblingDB("foo").dropDatabase();
      

      Check and confirm on the shard servers the amount of data remaining.

      Primary shard will have no data for this database.

      Secondary shards will still have db files existing as the MongoS did not route the drop command to these shards.

      The drop of the database should be routed to the non-primary shards to cleanup. We should do some preflight checks before the drop and then use that to help determine where the drops are needed.

            Assignee:
            Unassigned Unassigned
            Reporter:
            david.hows David Hows
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: