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

The targetOpTimeCB callback can capture an invalid lock.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Replication
    • Fully Compatible
    • ALL
    • Repl 2025-03-31
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The targetOpTimeCB callback captures the lock by reference, however this callback is run in a future chain, when it is executed, this lock can no longer be valid.

      When we call those functions to fulfill the a replication waiter's promise, the targetOpTimeCB callback will be executed by the same thread, but this thread holds a different lock than the one targetOpTimeCB captured.

      This is caused by SERVER-90314. Prior to SERVER-90314, this was not an issue because we were not passing WithLock explicitly everywhere so no need to capture the lock.

            Assignee:
            brad.cater@mongodb.com Brad Cater
            Reporter:
            wenbin.zhu@mongodb.com Wenbin Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None