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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.2.1, 4.3.1
    • Replication
    • None
    • Fully Compatible
    • ALL
    • v4.2
    • Repl 2019-09-23, Repl 2019-10-07
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: