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

foreground index build blocks database reads and writes

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.8.0-rc5
    • Component/s: 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

      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.

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

              Created:
              Updated:
              Resolved: