[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:
Depends
Related
is related to SERVER-74202 Update balancer to use client local P... Closed
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: SERVER-70129 std::random_device should be created per thread in the balancer
Branch: master
https://github.com/mongodb/mongo/commit/77a5f7df727381c62791bb56f009438657c3a1c7

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