Make CollectionScan on oplog work without holding database/collection lock

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Storage Execution
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

              Assignee:
              [DO NOT USE] Backlog - Storage Execution Team
              Reporter:
              Lingzhi Deng
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: