When sharding an empty collection, it is possible to pre-split the chunks across the cluster depending on the split policy initially associated with the collection. For example, if the shard key is hashed and an initial number of chunks is specified (using the numInitialChunks parameter) then the chunks will be equally distributed among the shards in the cluster automatically, given that the collection is empty.
When committing the chunks to the config server, an upsert is used, this works fine for a small number of chunks (for example a thousand) but, with a large enough number, it is making one node on the config server to crash. The upsert operation could be replaced by an insert, but then the limitation will be the size of the BSONObj on the command.
- causes
-
SERVER-72301 Use ordered:false when inserting chunks in optimized path of create collection
- Closed
- is caused by
-
SERVER-52779 Implement the new create/shard collection path in `_shardsvrShardCollection`
- Closed