Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-41558

Make CollectionScan on oplog work without holding database/collection lock

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

      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:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: