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

foreground index build blocks database reads and writes

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.8.0-rc5
    • Index Maintenance
    • None
    • ALL
    • Hide

      1) start an index create that takes 10+ seconds for a collection in database "a"
      2) wait a few seconds and then get thread stacks using PMP – http://poormansprofiler.org/

      Show
      1) start an index create that takes 10+ seconds for a collection in database "a" 2) wait a few seconds and then get thread stacks using PMP – http://poormansprofiler.org/
    • Storage NYC 2019-01-28
    • 0

    Description

      Some discussion is at https://groups.google.com/forum/#!topic/mongodb-dev/_1IrogzovEQ. When I create an index with background:false then many (all?) operations in the db are blocked even for engines like WiredTiger that don't require a per-db writer lock. The URL above shows thread stacks where background jobs (TTLMonitor, ClientCursorMonitor) get blocked on a per-db lock by a background:false index create. I assume bad things can happen when TTL enforcement doesn't run for too long.

      This creates other problems as "show collections", db.$foo.getIndexes() and queries from other collections in the same database will be blocked for the duration of the index create.

      While background:true is the workaround background index creation can take more time.

      Attachments

        Activity

          People

            louis.williams@mongodb.com Louis Williams
            mdcallag Mark Callaghan
            Votes:
            6 Vote for this issue
            Watchers:
            21 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: