[SERVER-23258] ReplicationCoordinatorImpl::_reportUpstream_inlock() should always release lock on return. Created: 21/Mar/16  Updated: 25/Jan/17  Resolved: 21/Mar/16

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.3.4

Type: Bug Priority: Minor - P4
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

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



 Comments   
Comment by Githook User [ 21/Mar/16 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-23258 ReplicationCoordinatorImpl::_reportUpstream_inlock() always releases lock on return.
Branch: master
https://github.com/mongodb/mongo/commit/312062eeadd163f1877d7cb466a10183b5af2f01

Generated at Thu Feb 08 04:02:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.