[SERVER-84637] moveCollection should be able to move a collection with unique indexes on unsplittable collections Created: 08/Jan/24  Updated: 02/Feb/24

Status: Needs Scheduling
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 8.0 Required

Type: Bug Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Kshitij Gupta
Resolution: Unresolved Votes: 0
Labels: cs-subteam2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File move_collection_on_unsplittable_collection_with_unique_index.js    
Operating System: ALL
Steps To Reproduce:

Run the patch attached with all feature flags

Participants:
Story Points: 3

 Description   

Unsplittable collections by definition are tracked collections with only one chunk. The internal representation in config.collections requires a 'shard key', however, considering that in order to shard it the shardCollection command must be called, they can be treated as collections with all the data on the same shard, so, any unique index created for the collection, can be preserved even if the collection is moved. This means that the uniqueness constraint validation executed by resharding (which is the machinery used by moveCollection) it should not apply for unsplittable collections.


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