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

Fix race in PrepareConflictTracker

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.4
    • Affects Version/s: None
    • Component/s: Concurrency
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2019-12-02, Execution Team 2019-12-30, Execution Team 2020-01-13, Execution Team 2020-01-27, Execution Team 2020-02-10, Execution Team 2019-12-30, Execution Team 2020-02-24, Execution Team 2020-03-09
    • 0

      The PrepareConflictTracker uses an atomic boolean to indicate that a client is waiting on a prepare conflict, but that does not actually protect the _prepareConflictDuration from being concurrently written to and read from.

      In addition to fixing this race, presumably by using another atomic variable, also make sure that the endPrepareConflict code is a no-op (and does no atomic operations) for cases where there were no prepare conflicts. This is needed because this code is executed for every storage engine level read operation and is therefore very hot, and shows up in profiling information.

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: