-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Sharding NYC
The following usages of std::rand have been recently introduced on the query analyzer code path:
- https://github.com/mongodb/mongo/blob/c47affa6b78dbf1da11a648f22ce7c196ff4bddf/src/mongo/s/query_analysis_sampler_util.cpp#L70
- https://github.com/mongodb/mongo/blob/c47affa6b78dbf1da11a648f22ce7c196ff4bddf/src/mongo/s/query_analysis_sampler_util.cpp#L75
- https://github.com/mongodb/mongo/blob/c47affa6b78dbf1da11a648f22ce7c196ff4bddf/src/mongo/s/commands/cluster_analyze_shard_key_cmd.cpp#L92
And in some related unit tests.
The use of std::rand is discouraged in production for the reasons pointed out in SERVER-72373 and does not provide real randomization in unit tests because of SERVER-72366.
- duplicates
-
SERVER-72373 Ban `rand`
- Closed