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

dropDatabase very slow due to repeated calls to closeAllCursors

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.2.15, 3.4.6
    • 4.0.0-rc0
    • Storage
    • Fully Compatible
    • ALL

    Description

      Example:

      • dropDatabase with about 70 collections with 2 indexes each for a total of about 200 WT tables
      • about 325k open cursors
      • dropDatabase takes about 30 seconds and holds the global lock the entire time.

      Collecting perf data shows mongod using 100% of a CPU for the duration, all in this stack:

      mongo::WiredTigerSession::closeAllCursors(std::__cxx11::basic_string<...> const&)
      mongo::WiredTigerSessionCache::closeAllCursors(std::__cxx11::basic_string<...> const&)
      mongo::WiredTigerKVEngine::_drop(mongo::StringData)
      mongo::WiredTigerKVEngine::dropIdent(mongo::OperationContext*, mongo::StringData)
      

      For each of the 200 WT tables dropped we call closeAllCursors for that table. The perf stacks show all the time is spent in closeAllCursors itself, and the ftdc metrics also show that we aren't actually closing any cursors, so it appears that all the time is spent by closeAllCursors scanning the list of 325k open cursors to find cursors with a matching table uri.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-execution Backlog - Storage Execution Team
              bruce.lucas@mongodb.com Bruce Lucas
              Votes:
              29 Vote for this issue
              Watchers:
              37 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: