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().