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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.3.4
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL

      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);
      

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

              Created:
              Updated:
              Resolved: