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

dropDatabase very slow due to repeated calls to closeAllCursors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.2.15, 3.4.6
    • Fix Version/s: 4.0.0-rc0
    • Component/s: Storage
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Case:

      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

              • Votes:
                29 Vote for this issue
                Watchers:
                37 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: