Race in wiredTigerPrepareConflictRetry

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.1.9
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • Storage NYC 2019-02-11, Storage NYC 2019-02-25
    • 17
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In wiredTigerPrepareConflictRetry, we make the attempt to do the read here

      https://github.com/mongodb/mongo/blob/916a5553/src/mongo/db/storage/wiredtiger/wiredtiger_prepare_conflict.h#L66

      We then wait by noting the value of the _lastCommitOrAbortCounter and waiting for it to change here:

      https://github.com/mongodb/mongo/blob/916a5553/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp#L336

      But we don't lock the mutex associated with _lastCommitOrAbortCounter until here

      https://github.com/mongodb/mongo/blob/916a5553/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp#L334

      So if _lastCommitOrAbortCounter updates after the prepare conflict but before we get the lock, we could wait indefinitely

            Assignee:
            Xiangyu Yao (Inactive)
            Reporter:
            Matthew Russotto (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: