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

Certain ServerStatusMetricFields can lead to a data race

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • Service Arch 2022-08-22

      Unless ServerStatusMetricField relies on a storage container which provides thread-safe primitives, the serverStatus command can report corrupted data if one thread is reading the contents of a field while another is writing to it.

      The current code base contains at least one instance of it where a ServerStatusMetricField is built out of a std::string which doesn't guarantee thread safety.

      It is worth to notice that this should be carefully designed as it could lead to service degradation due to the introduction of currently inexistent contention and metrics are spread throughout all of the code base.

      Acceptance Criteria: Either create a mechanism to atomically swap the contents of a ServerStatusMetricField or make sure all stored types are thread-safe by design.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            daniel.morilha@mongodb.com Daniel Morilha (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: