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

Recipient should not do reads/writes while holding the instance mutex

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Repl 2021-02-08, Repl 2021-02-22
    • 10

      Recipient updates state docs while holding onto the instance mutex, see this example. This is problematic because updateStateDoc needs to acquire RSTL in IX mode but stepDown would interrupt() the migration (as part of _performPostMemberStateUpdateAction) while holding RSTL in X mode. interrupt() needs to acquire the instance mutex. So this could introduce a deadlock - the updateStateDoc on the recipient thread waits on RSTL IX mode v.s. the interrupt() on stepDown thread is waiting on the instance mutex while holding RSTL in X mode.

            Assignee:
            xuerui.fa@mongodb.com Xuerui Fa
            Reporter:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: