waitForSession can miss JournalListener onDurable calls

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: 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
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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
            Reporter:
            Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: