[SERVER-44911] Make index operations abort concurrent outgoing migrations Created: 02/Dec/19  Updated: 29/Oct/23  Resolved: 11/Dec/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.3.3

Type: Task Priority: Major - P3
Reporter: Jack Mulrow Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2019-12-16
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 11/Dec/19 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'cheahuychou.mao@mongodb.com', 'username': 'cheahuychou'}

Message: SERVER-44911 Make index operations abort concurrent outgoing migrations
Branch: master
https://github.com/mongodb/mongo/commit/6dfa4748f017315300a32982b63fe71e8a68d42d

Generated at Thu Feb 08 05:07:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.