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

std::random_device should be created per thread in the balancer

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Sharding EMEA 2022-10-31, Sharding EMEA 2022-11-14
    • 12

      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.

            Assignee:
            enrico.golfieri@mongodb.com Enrico Golfieri
            Reporter:
            allison.easton@mongodb.com Allison Easton
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: