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

Make index operations abort concurrent outgoing migrations

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.3
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • Sharding 2019-12-16

      As described in this section of the design, starting an index build, dropping an index, and executing collMod should abort any active outgoing migrations on a shard.

      One way to do this is through the OpObserver interface. From the design:

      The donor will use the OpObserver interface to detect new index operations. Before sending _recvChunkStart to the recipient shard, while holding a collection lock, the donor will install a listener that tracks if an index operation has completed (e.g. a ServiceContext decoration with an atomic boolean). Throughout the migration, and at least after entering the critical section, the donor will check if this listener was triggered, and abort if so.

      The specific OpObserver events that will abort a migration:

      • onStartIndexBuild
      • onDropIndex
      • onCollMod

      Note that an index build in FCV 4.2 will not trigger onStartIndexBuild, and instead only trigger the onCreateIndex event when the index is almost finished. To avoid wasted work for background index builds in FCV 4.2, the listener used by the migration will be specially triggered when the build starts and becomes an in-progress build in the IndexCatalog, not through the OpObserver.

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            jack.mulrow@mongodb.com Jack Mulrow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: