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

Make ReadWriteAbility::_canAcceptNonLocalWrites AtomicWord<bool> to prevent torn reads.

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • v4.0, v3.6, v3.4
    • Repl 2019-05-20

    Description

      Currently, we are accessing _canAcceptNonLocalWrites in an unsafe manner by NOT taking any RSTL lock.  This can lead to torn read/ undefined behavior if concurrently a step up/step down thread is modifying the value.

      And, they all are best effort checks. So, it's ok to just make reading _canAcceptNonLocalWrites thread safe.

      Attachments

        Issue Links

          Activity

            People

              vesselina.ratcheva@mongodb.com Vesselina Ratcheva (Inactive)
              suganthi.mani@mongodb.com Suganthi Mani
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: