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

Index builder must check for interrupt between collection scan and bulk load phases

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.7, 5.0.0-rc0
    • Affects Version/s: 4.4.0, 4.9.0
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Execution Team 2021-05-03
    • 18

      We frequently call checkForInterrupt() so that index builds can be quickly aborted. We do this on each iteration of collection scanning and bulk-loading sorted keys into the index.

      If an index build is aborted between these two phases, this invariant will fail because the MultiIndexBlock has already been cleaned up by a different thead.

      This scenario is normally protected by Collection X lock held by the operation aborting the index build, but the index builder will yield/restore while scanning.

      I think this invariant can fail if an index build is aborted while it is yielding, and after it restores it hits the end of the collection and does not call checkForInterrupt(). We need to call checkForInterrupt() in dumpInsertsFromBulk before checking the _buildIsCleanedUp invariant.

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

              Created:
              Updated:
              Resolved: