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

concurrent dropIndexes on a primary can stall replication on secondaries

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc0, 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Execution Team 2020-03-09, Execution Team 2020-03-23
    • 50

      If there are two concurrent "dropIndexes" commands on a collection (one on each index A and B), this can lead to the following order of operations on the secondary:

      • startIndexBuild A
      • startIndexBuild B
      • commitIndexBuild A
      • dropIndexes A -> blocks due concurrent index build B
      • abortIndexBuild B -> never reached due to blocking previous operation (from a separate dropIndexes command)

      The blocking is caused by the assertion that no background operations are in progress when processing the dropIndexes oplog entry for "a_1". This throws and blocks oplog application. dropIndexesForApplyOps assumes that no background operations are in progress, which is not always the case. The non-applyOps version of dropIndexes has a similar assertion which only gets executed when no index builds were aborted.

      What I think might be the root causes of this failure:

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

              Created:
              Updated:
              Resolved: