-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.6.0-rc0
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
ALL
-
Platforms 2017-10-23
-
0
All usages of dispatch in the sessions collection management utility acquire database/collection locks. My suspicion is that these locks are taken for replica set primary check further down.
Acquiring these locks has the potential of causing the code executed by DBDirectClient further down to deadlock if it happens to cause lock mode upgrade.
All of these lock usages other than findRemovedSessions already issue write commands which will fail if the node is not primary, so this is not a problem. For findRemovedSessions, the read will fail because it doesn't have the slaveOk bit set, so this is not a problem either.
Based on this I think it is safe to remove the lock acquisitions from dispatch altogether, which would simplify the code.