Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-41248

Ensure ReplicaSetMonitor initializes its random state with truly random data

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.14, 4.0.13
    • Affects Version/s: 3.6.12, 4.0.9
    • Component/s: Internal Code
    • Labels:
    • Fully Compatible
    • ALL
    • v4.0, v3.6
    • Service Arch 2019-07-15, Service Arch 2019-08-12, Service Arch 2019-08-26

      The replica set monitor in older versions of the server initializes it's random state via:


      SetState::SetState(...) :

      which has the unfortunate side effect of being strongly synchronized with the system clock. This can cause non-random patterns of access across a mongos / series of mongos' in cases where all of the nodes are restarted at the same time and work is distributed evenly across the various mongos'.

      Switching to use a real source of randomness for seeding the prngs in each set state should improve the real randomness of later server selection

      Note: It appears this was fixed in 4.2 as part of unrelated code changes

            ben.caimano@mongodb.com Benjamin Caimano (Inactive)
            mira.carey@mongodb.com Mira Carey
            0 Vote for this issue
            7 Start watching this issue