[SERVER-70129] std::random_device should be created per thread in the balancer Created: 30/Sep/22 Updated: 29/Oct/23 Resolved: 01/Nov/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.2.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Allison Easton | Assignee: | Enrico Golfieri |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sharding-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | Sharding EMEA 2022-10-31, Sharding EMEA 2022-11-14 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 12 | ||||||||||||
| Description |
|
As part of introducing the defragmentation policy, we introduced a secondary thread in the balancer. This thread processes the non-migration requests from the defragmentation policy. This thread randomizes which collections it works on using std::uniform_int_distribution. The std::uniform_int_distribution uses a random device to create the distribution. Currently, we are using the same random device on both the main balancer thread and on the new secondary thread. We instead need to create a separate random device for each thread of the balancer. |
| Comments |
| Comment by Githook User [ 31/Oct/22 ] |
|
Author: {'name': 'Enrico Golfieri', 'email': 'enrico.golfieri@mongodb.com', 'username': 'enricogolfieri'}Message: |