AutoGetCollectionForReadLockFree is checking repl state multiple times without holding RSTL

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2020-12-14, Execution Team 2020-12-28
    • 15
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SnapshotHelper::shouldReadAtLastApplied is called explicitly from AutoGetCollectionForReadBase and via SnapshotHelper::getNewReadSource. It is checking ReplicationCoordinator::canAcceptWritesForDatabase which can change as we're not holding the RSTL. A different answer would trigger the following fassert: https://github.com/mongodb/mongo/blob/51e3e36ac48cac80c920e5e418013fdb0a6747f2/src/mongo/db/db_raii.cpp#L262-L265

            Assignee:
            Henrik Edin
            Reporter:
            Henrik Edin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: