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

indexbg_restart_secondary.js can race processing a commitIndexBuild oplog entry and interrupting an index build due to shutdown

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.3
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Execution Team 2020-01-27
    • 18

      When secondaries receive exceptions during index builds, they rethrow immediately. This results in the index build also getting torn down immediately, because we call abortIndexBuildWithoutCleanup() while tearing down the index build.

      Once the index build thread tears down, it unregisters itself. If the oplog applier is concurrently processing of the commitIndexBuild oplog entry, the call to abortIndexBuild will throw a NoSuchKey error here. We ignore NoSuchKey, so the commitIndexBuild gets processed and the stable timestamp is allowed to advance.

      Upon restarting, the unfinished index build will never be completed because the "commitIndexBuild" has already been processed without successfully committing the index.

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

              Created:
              Updated:
              Resolved: