[SERVER-36407] Use AutoCollection instead of AutoCollectionForRead Created: 01/Aug/18  Updated: 04/Sep/18  Resolved: 13/Aug/18

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

Type: Bug Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Mark Benvenuto
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-36225 Do not hold replication mutex when ca... Closed
Operating System: ALL
Participants:
Linked BF Score: 63

 Description   

Free Monitoring uses AutoCollectionForRead, unfortunately using this class can cause a deadlock with replication during startup. The deadlock can occurs because two the collection MODE_IS lock and _mutex in ReplicationCoordinatorImpl are taken in different orders The ReplicationCoordinatorImpl::_finishLoadLocalConfig method takes the {{_mutex first and then MODE_IS lock while AutoCollectionForRead takes it in the opposite order.

A simple fix is to switch to AutoCollection since free monitoring does not need to wait for changes to replicate when it polls the local admin database on the primary or secondary.



 Comments   
Comment by Mark Benvenuto [ 13/Aug/18 ]

Closing as won't fix since SERVER-36225 was fixed which solves the deadlock this bug was trying to work around.

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