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

Limit the number of simultaneous index builds running from user connections to 3

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4.0-rc0, 4.7.0
    • Component/s: Index Maintenance
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.4
    • Sprint:
      Execution Team 2020-04-06
    • Linked BF Score:
      18

      Description

      Each index build (i.e. a single createIndexes command, which may build more than one index) is allowed to use up to 200MB of memory outside of the WT cache by default. This is controlled by maxIndexBuildMemoryUsageMegabytes. In an attempt to bound memory usage and reduce WT cache pressure, we introduced a limit the number of concurrent index builds started in SERVER-44984. This limit was bug-prone and also applied to index builds on secondaries. This ticket imposes a concurrent limit on index builds started by users on primaries, effectively the same observable behavior.

      On primaries, any index builds started by a user over the limit will block until the number of concurrent index builds drops below the limit. The log message "Too many index builds running simultaneously, waiting until the number of active index builds is below the threshold" (ID 4715500) will be logged when the limit is reached and an index build has blocked.

      This default limit can be raised with the maxNumActiveUserIndexBuilds setParameter. This can be changed at startup or runtime.

      Original Description

      Both the primary and secondary nodes will have an unlimited thread pool size. This is done to allow secondary nodes to startup as many index builders as necessary in order to prevent scheduling deadlocks during initial sync or oplog application.

      When commands are run from user connections that need to create indexes, those commands will hang until there are less than 3 running index builder threads, or until the operation is interrupted.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gregory.wlodarek Gregory Wlodarek
              Reporter:
              gregory.wlodarek Gregory Wlodarek
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: