[SERVER-84161] Reshard Collection to the Same Shard Efficiency Improvement Created: 13/Dec/23  Updated: 18/Dec/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Matt Panton Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: cs-subteam1, tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Cluster Scalability
Participants:

 Description   

Resharding a collection that is only located on one shard and has one chunk and is being resharded to only that shard (meaning the only shard it currently exists on) should be efficient as no data movement is required. We only have to do index creation (if the new shard key is not _id) and the metadata change commit.

This will also be an optimization for unsharding a collection that only exists on one shard already as well.



 Comments   
Comment by Kshitij Gupta [ 13/Dec/23 ]

I wonder if we should solve this generally for resharding rather than just unshardCollection specific where if the existing collection is on one shard, with one chunk and the same shard is guaranteed to own all the data post-resharding, we just do index creation (which can be skipped if the new shard key is _id) and a metadata change commit.

Generated at Thu Feb 08 06:54:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.