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

ReplicationCoordinatorImpl::_reportUpstream_inlock() should always release lock on return.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.4
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      Currently, _reportUpstream_inlock(unique_lock* lock) does not guarantee the state of lock upon return. This makes it harder to reason about code in which we subsequently invoke functions (such as updateTerm_incallback()) that expect to lock the mutex:

      replication_coordinator_impl.cpp:443

          _reportUpstream_inlock(&lk);
          _externalState->setGlobalTimestamp(lastOpTime.getTimestamp());
          // Step down is impossible, so we don't need to wait for the returned event.
          _updateTerm_incallback(term);
      

        Attachments

          Activity

            People

            Assignee:
            benety.goh Benety Goh
            Reporter:
            benety.goh Benety Goh
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: