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

XMLWordPrintableJSON

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

      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
              Reporter:
              Lingzhi Deng
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: