[SERVER-44943] avoid taking the PBWM lock in ReplicationCoordinatorExternalStateImpl::oplogExists() Created: 04/Dec/19  Updated: 29/Oct/23  Resolved: 11/Dec/19

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

Type: Bug Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-38341 Remove Parallel Batch Writer Mutex Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2019-12-16
Participants:
Linked BF Score: 21

 Description   

This function is used by the read concern code to check if the oplog collection is initialized and can be called on both primaries and secondaries. On secondary nodes, the current implementation, introduced in SERVER-35870, uses the collection lock RAII type, which implicitly acquires the PBWM lock.

The oplog collection check is currently done using the AutoGetCollection RAII type, which requires the PBWM lock. It should be possible to avoid taking any locks by querying the CollectionCatalog directly. An alternative to the CollectionCatalog might be to use LocalOplogInfo::getCollection().



 Comments   
Comment by Githook User [ 11/Dec/19 ]

Author:

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

Message: SERVER-44943 make ReplicationCoordinatorExternalStateImpl::oplogExists() lock-free
Branch: master
https://github.com/mongodb/mongo/commit/79af378abece4049e2042cfcfcf2275aff7c3fb8

Generated at Thu Feb 08 05:07:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.