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

ReplicationStateTransitionLockGuard::_unlock doesn't work with its move constructor

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.1, 4.3.1
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v4.2
    • Repl 2019-09-23, Repl 2019-10-07
    • 0

      If a ReplicationStateTransitionLockGuard ("this") is constructed via the move constructor, it inherits the RSTL lock from "other" and "other"'s _result is then set to LOCK_INVALID. However, when "other" is destructed, it calls ReplicationStateTransitionLockGuard::_unlock which unlocks the RSTL using the same _opCtx as "this". As a result, "this" no longer holds the RSTL even though "this"._result is LOCK_OK.

            Assignee:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Reporter:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: