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

waitForSession can miss JournalListener onDurable calls

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution NAMER
    • Fully Compatible
    • ALL
    • Execution NAMR Team 2023-09-04, Execution NAMR Team 2023-09-18

      Suppose two threads have reached this point in waitForDurable:

      https://github.com/10gen/mongo/blob/05d6797149cdae13a26693371ccd7b5b8e4aaadd/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp#L332

      Each has obtained a journal token, one of which is older than the other. If the thread with the older token proceeds first, the thread with the newer token will exit here:

      https://github.com/10gen/mongo/blob/05d6797149cdae13a26693371ccd7b5b8e4aaadd/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp#L340

      without having called onDurable on the newer token, resulting in the newer token not being marked durable (though it is). I think this can be fixed by calling onDurable in the early exit path.

      This was discovered during code inspection.

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            matthew.russotto@mongodb.com Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: