[SERVER-41558] Make CollectionScan on oplog work without holding database/collection lock Created: 05/Jun/19  Updated: 06/Dec/22  Resolved: 07/Jun/19

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

Type: Question Priority: Major - P3
Reporter: Lingzhi Deng Assignee: Backlog - Storage Execution Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-41448 TransactionHistoryIterator should alw... Closed
Related
is related to SERVER-41448 TransactionHistoryIterator should alw... Closed
Assigned Teams:
Storage Execution
Participants:

 Description   

Currently, CollectionScan eventually calls this which then calls databaseHolder->getDb where we invariant a database IS lock is held.

mongod(void mongo::invariantWithLocation<bool>(bool const&, char const*, char const*, unsigned int) 0x3F) [0x5579e275041b]
mongod(mongo::DatabaseHolderImpl::getDb(mongo::OperationContext*, mongo::StringData) const 0x91) [0x5579e314717f]
mongod(mongo::RequiresCollectionStageBase<mongo::Collection const*>::getDatabaseEpoch(mongo::Collection const*) const 0x106) [0x5579e32ead18]
mongod(mongo::RequiresCollectionStageBase<mongo::Collection const*>::RequiresCollectionStageBase(char const*, mongo::OperationContext*, mongo::Collection const*) 0xD6) [0x5579e32e9a4e]
mongod(mongo::CollectionScan::CollectionScan(mongo::OperationContext*, mongo::Collection const*, mongo::CollectionScanParams const&, mongo::WorkingSet*, mongo::MatchExpression const*) 0x69) 

I heard that we have plan to make oplog special so we can do oplog traversal with global lock only. As part of SERVER-41448, we plan to make TransactionHistoryIterator only take global IS lock. So, I am wondering is it possible to special case oplog read to not take a database or a collection lock?

CC siyuan.zhou



 Comments   
Comment by Eric Milkie [ 07/Jun/19 ]

The linked ticket will be solving this issue.

Comment by Eric Milkie [ 06/Jun/19 ]

Yes, I think that would be reasonable to make an exception on the locking requirements for local.oplog.rs namespace.

Comment by Siyuan Zhou [ 05/Jun/19 ]

milkie and benety.goh, we tried to use the oplog collection pointer from LocalOplogInfo for oplog reading while only holding global lock IS lock, but it seems DatabaseHolderImpl checks for DB lock. Does it make sense to make an exception for oplog here?

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