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

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

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

      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.

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

              Created:
              Updated:
              Resolved: