[SERVER-81370] Make all InitialSplitPolicy accept a set of available shards Created: 22/Sep/23  Updated: 26/Oct/23  Resolved: 26/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Pol Pinol Assignee: Pol Pinol
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-78918 Make `shardCollection` command shard ... Closed
Assigned Teams:
Sharding EMEA
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2023-10-02, Sharding EMEA 2023-10-16, Sharding EMEA 2023-10-30
Participants:

 Description   

The InitialSplitPolicy class is used to generate a list of initial chunks to be created during a shardCollection operation. The chunk distribution is based on the split policy, i.e., based on the input parameters and the collection state. When distributing the chunks to the shards, the shards are randomly shuffled, so two calls to 'createFirstChunks' may not result in the same chunk distribution. 

The goal of this ticket is to add a set of shards as a parameter in such a way that, if we call 'createFirstChunks' for each split policy involved in the createCollection, we always return a chunk distribution that respects the given shards. With that, we guarantee that we will return a chunk distribution that distributes at least one chunk per given shard, and no new shards will be involved in the chunk distribution.  

It is not a goal of this ticket to always return the same chunk distribution. 

We have an example of this work at SamplingBasedSplitPolicy, a split point building strategy for resharding.



 Comments   
Comment by Githook User [ 26/Oct/23 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-81370 Make all InitialSplitPolicy accept a set of available shards
Branch: master
https://github.com/mongodb/mongo/commit/5d742ee1bda0acb84363bf5cd09aa51e082cc3cc

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