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

create index blocked by checkpoint mutex

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 4.0.3
    • Component/s: Concurrency
    • None
    • Server Triage
    • ALL

      when create index with background on one database, the database x lock held for a long time, with the help of gdb, i found it was blocked by the wiredtiger's checkpoint mutex, the gdb stack is:

      Thread 145 (Thread 0x7fab66ff4700 (LWP 1426590)):
      #0 __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
      #1 0x00007fab8e9cc479 in _L_lock_909 () from /lib/x86_64-linux-gnu/libpthread.so.0
      #2 0x00007fab8e9cc2a0 in _GI__pthread_mutex_lock (mutex=0x55620d9a7538) at ../nptl/pthread_mutex_lock.c:79
      #3 0x0000556208d4180b in __session_alter ()
      #4 0x0000556208cdb5c5 in mongo::WiredTigerUtil::setTableLogging(_wt_session*, std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bo
      ol) ()
      #5 0x0000556208cdbb58 in mongo::WiredTigerUtil::setTableLogging(mongo::OperationContext*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
      const&, bool) ()
      #6 0x0000556208ca6ea4 in mongo::WiredTigerIndex::WiredTigerIndex(mongo::OperationContext*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
      > const&, mongo::IndexDescriptor const*, mongo::KVPrefix, bool) ()
      #7 0x0000556208ca7125 in mongo::WiredTigerIndexStandard::WiredTigerIndexStandard(mongo::OperationContext*, std::__cxx11::basic_string<char, std::char_traits<char>, std::
      allocator<char> > const&, mongo::IndexDescriptor const*, mongo::KVPrefix, bool) ()
      #8 0x0000556208cae9a7 in mongo::WiredTigerKVEngine::getGroupedSortedDataInterface(mongo::OperationContext*, mongo::StringData, mongo::IndexDescriptor const*, mongo::KVPr
      efix) ()
      #9 0x0000556208e2ab4d in mongo::KVDatabaseCatalogEntry::getIndex(mongo::OperationContext*, mongo::CollectionCatalogEntry const*, mongo::IndexCatalogEntry*) ()
      #10 0x000055620936b550 in mongo::IndexCatalogImpl::_setupInMemoryStructures(mongo::OperationContext*, std::unique_ptr<mongo::IndexDescriptor, std::default_delete<mongo::I
      ndexDescriptor> >, bool) ()
      #11 0x0000556209d21a9e in mongo::IndexCatalog::_setupInMemoryStructures(mongo::OperationContext*, std::unique_ptr<mongo::IndexDescriptor, std::default_delete<mongo::Index
      Descriptor> >, bool) ()
      #12 0x0000556209364029 in mongo::IndexCatalogImpl::IndexBuildBlock::init() ()
      #13 0x0000556209374b2e in mongo::MultiIndexBlockImpl::init(std::vector<mongo::BSONObj, std::allocator<mongo::BSONObj> > const&) ()
      #14 0x000055620925cb0f in auto mongo::writeConflictRetry<mongo::CmdCreateIndex::errmsgRun(mongo::OperationContext*, std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::BSONObj const&, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, mongo::BSONObjBuilder&)::{lambda()#6}>(mongo::OperationContext*, mongo::StringData, mongo::CmdCreateIndex::errmsgRun(mongo::OperationContext*, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::BSONObj const&, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, mongo::BSONObjBuilder&)::{lambda()#6}, mongo::CmdCreateIndex::errmsgRun(mongo::OperationContext*, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::BSONObj const&, std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, mongo::BSONObjBuilder&)::{lambda()#6}&&) ()

            Assignee:
            backlog-server-triage [HELP ONLY] Backlog - Triage Team
            Reporter:
            hustchensi Jack Chan
            Votes:
            1 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: