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

Implicit collection creation from createIndexes can stall replication on secondaries by circumventing thread pool on primary

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.3
    • Affects Version/s: 4.3.3
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2020-01-13, Execution Team 2020-01-27, Execution Team 2019-12-30
    • 43

      Implicit collection creation bypasses the IndexBuildsCoordinator thread pool on the primary and replicates "startIndexBuild" oplog entries directly. The thread pool size is 10 on both primaries and secondaries, and is used to limit resource usage. Each additional index build will block until a thread resource is available.

      This is problematic in the following scenario:

      • Start, but do not complete 10 (or the current thread pool size) index builds on the primary.
      • Using createIndexes, implicitly create a collection as of SERVER-44405. This will replicate a "startIndexBuild" oplog entry, but will block on the secondary because all thread pool resources are in use. None of the in-progress index builds can commit because replication is now blocked.

      This results in a deadlock, which stalls replication on the secondary

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: