Add a rewriteCollection command to avoid the confusion of "reshard back to the same shard key"

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • Cluster Scalability
    • Cluster Scalability Priorities
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      we need a rewriteCollection command because customers are finding "reshard to shard", "reshard back to same shard key" to add/remove shards or reclaim disk space quite confusing. They are essentially rewriting data so we should call it that. 

      All use cases are listed here - https://www.mongodb.com/docs/manual/tutorial/resharding-back-to-same-key/#reshard-a-collection-back-to-the-same-shard-key 

       

      OG text below: 

      The compact command returns free space back to the OS. While it's successful in achieving that, it's usefulness is limited to situations where free space exists and isn't likely to be reused (e.g., bulk delete and right-size or archiving). It isn't intended to handle situations where space is amplified due to usage patterns resulting in a poor on-disk layout.

      The moveCollection command rewrites the file which would correct these situations. We should consider aliasing (e.g., rewriteCollection) the command for this use case.

            Assignee:
            Unassigned
            Reporter:
            Steve Kuhn
            Votes:
            1 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated: