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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.1, 4.3.1
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2
    • Sprint:
      Repl 2019-09-23, Repl 2019-10-07
    • Linked BF Score:
      0

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: