[SERVER-46546] Only seed the RNG once in sharding_multiversion tests Created: 02/Mar/20  Updated: 29/Oct/23  Resolved: 03/Mar/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 4.3 Desired
Fix Version/s: 4.3.5

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

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2020-03-09
Participants:

 Description   

Currently, in the sharding_multiversion suite, we are seeding the random number generator for each replica set rather than seeding it only once. This makes reproducing the tests in sharding_multiversion more difficult.
This line here should instead be something like:

self.seedRandomNumberGenerator = opts.hasOwnProperty('seedRandomNumberGenerator') ? opts.seedRandomNumberGenerator : true;

Additionally, the check in shardingtest.js here should be checking jsTest.options().useRandomBinVersionsWithinReplicaSet instead of the no longer used jsTest.options().randomBinVersions.



 Comments   
Comment by William Schultz (Inactive) [ 04/Mar/20 ]

jason.chan I feel that this may be a more general issue whenever a test starts up multiple ReplSetTest instances. I recently encountered this in the disallow_adding_initialized_node1.js test e.g.

[js_test:disallow_adding_initialized_node1] 2020-03-04T05:54:07.171+0000 Starting JSTest jstests/replsets/disallow_adding_initialized_node1.js...
[js_test:disallow_adding_initialized_node1] 2020-03-04T05:54:07.614+0000 ReplSetTest starting set 'disallow_adding_initialized_node1'
[js_test:disallow_adding_initialized_node1] 2020-03-04T05:54:07.615+0000 setting random seed: -5798830423199588000
[js_test:disallow_adding_initialized_node1] 2020-03-04T05:54:08.906+0000 ReplSetTest starting set 'disallow_adding_initialized_node1'
[js_test:disallow_adding_initialized_node1] 2020-03-04T05:54:08.907+0000 setting random seed: 7737753121339076000

Ideally, it seems that we should only need to set a random seed once, globally, for each mongo shell process that we start up. I wonder if here we could set a seed only if it hasn't already been set previously.

Comment by Githook User [ 03/Mar/20 ]

Author:

{'username': 'jasonjhchan', 'name': 'Jason Chan', 'email': 'jason.chan@10gen.com'}

Message: SERVER-46546 Only seed the RNG once in sharding_multiversion tests
Branch: master
https://github.com/mongodb/mongo/commit/7fb62bff8bffb24dac650d17309b142f049908c1

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