[SERVER-75834] Accessing `MirrorMaestroImpl::_random` should be thread-safe Created: 07/Apr/23  Updated: 29/Oct/23  Resolved: 08/Apr/23

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Amirsaman Memaripour
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2023-04-17
Participants:
Linked BF Score: 2

 Description   

SERVER-72373 modified MirrorMaestro to use PseudoRandom to pick a normalized subset of eligible hosts. PseudoRandom, however, is not thread-safe and concurrent accesses could result in read-after-write data races. Since MirrorMaestro is accessing PseudoRandom through executor threads, we can either use a synchronization primitive or make instances of PseudoRandom thread-local to avoid read-after-write races.



 Comments   
Comment by Githook User [ 07/Apr/23 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-75834 Accessing `MirrorMaestroImpl::_random` should be thread-safe
Branch: master
https://github.com/mongodb/mongo/commit/c37705e5590787469c38d099e52bb9f01cc04043

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