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

foreground index build blocks database reads and writes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Gone away
    • Affects Version/s: 2.8.0-rc5
    • Fix Version/s: None
    • Component/s: Indexing
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      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/
    • Sprint:
      Storage NYC 2019-01-28
    • Case:
    • Story Points:
      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

          Issue Links

            Activity

              People

              • Votes:
                6 Vote for this issue
                Watchers:
                21 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: