Bug:
there's a deadlock in mongod between:
- ReplicationCoordinatorImpl::ElectionState::_onVoteRequestComplete() holding the ReplicationCoordinatorImpl::_mutex and attempting to acquire the BackgroundSync::_mutex when calling BackgroundSync::clearSyncTarget(), and
- BackgroundSync::_produce() holding the BackgroundSync::_mutex and attempting to acquire the ReplicationCoordinatorImpl::_mutex when calling ReplicationCoordinatorImpl::getMyLastAppliedOpTime().
Proposed fix:
We need to move _replCoord->getMyLastAppliedOpTime() before we acquire the mutex.
- is related to
-
SERVER-50869 Background sync may erroneously set applied-through during step-up
- Closed