[SERVER-28688] Deadlock between shutdown and stepdown Created: 07/Apr/17  Updated: 13/Feb/18  Resolved: 15/Apr/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.4.5, 3.5.6

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-33186 Primary node may deadlock during shut... Closed
is related to SERVER-7200 use oplog as op buffer on secondaries Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Repl 2017-05-08
Participants:
Linked BF Score: 0

 Description   

Stepdown calls ReplicationCoordinatorExternalStateImpl::startProducerIfStopped, which takes _threadMutex while holding the global exclusive lock. Shutdown calls ReplicationCoordinatorExternalStateImpl::shutdown which takes _threadMutex and then does a database read by calling _storageInterface->getAppliedThrough.

We should probably be doing the database reads/writes in ReplicationCoordinatorExternalStateImpl::shutdown after releasing _threadMutex.



 Comments   
Comment by Githook User [ 22/Apr/17 ]

Author:

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

Message: SERVER-28688 ReplicationCoordinatorExternalStateImpl::shutdown() performs database reads/writes outside lock

(cherry picked from commit bc135d00323ccbe35d7ba9030b3c20f7d28b34ad)
Branch: v3.4
https://github.com/mongodb/mongo/commit/861ebde6b8d83724f95fd8189da798ef5505a9f7

Comment by Githook User [ 15/Apr/17 ]

Author:

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

Message: SERVER-28688 ReplicationCoordinatorExternalStateImpl::shutdown() performs database reads/writes outside lock
Branch: master
https://github.com/mongodb/mongo/commit/bc135d00323ccbe35d7ba9030b3c20f7d28b34ad

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