[SERVER-49525] Sample documents to pick new split points for resharding when new shard key has a hashed field Created: 15/Jul/20  Updated: 29/Oct/23  Resolved: 05/Aug/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Task Priority: Major - P3
Reporter: Janna Golden Assignee: Kshitij Gupta
Resolution: Fixed Votes: 0
Labels: PM-234-M3, PM-234-T-new-split
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-49214 Add $toHashedIndexKey expression Closed
depends on SERVER-49510 Add functionality to pick new split p... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-08-10
Participants:

 Description   

Once the new $hash expression is created in SERVER-49214, we can use a similar agg pipeline as defined in SERVER-49510 to pick new split points during resharding for a shard key with a hashed field. The pipeline should use $hash for a hashed field, it should look like:

[
    {
        $sample: { size: numInitialChunks * s (where s = oversampling ratio }
    },
    {
        $project: {
            _id: 0,
            "sk0": {$ifNull: ["$shardKeyField0", null]}, 
            "sk1": {$toHashedIndexKey: <input>},
            ... and so on for each shard key field
        }
    },
    {
        $sort: { sk0: 1, sk1: 1 }
    },
]



 Comments   
Comment by Githook User [ 05/Aug/20 ]

Author:

{'name': 'Kshitij Gupta', 'email': 'kshitij.gupta@mongodb.com', 'username': 'kshitijng'}

Message: SERVER-49510: Add functionality to pick new split points during resharding when zones not defined. SERVER-49525: Sample documents to pick new split points for resharding when new shard key has a hashed field.
Branch: master
https://github.com/mongodb/mongo/commit/262e5a961fa7221bfba5722aeea2db719f2149f5

Generated at Thu Feb 08 05:20:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.