[SERVER-74449] Single phase index build (index creation with empty collections) does not abort migrations Created: 28/Feb/23  Updated: 29/Oct/23  Resolved: 17/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0, 6.0.6

Type: Bug Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File migration_abort_index_creation.js    
Issue Links:
Backports
Depends
Related
related to SERVER-74825 Remove checks from migration abort on... Closed
Assigned Teams:
Sharding EMEA
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0
Sprint: Sharding EMEA 2023-03-20
Participants:
Linked BF Score: 14

 Description   

When an index is being built, we have observers that abort any ongoing migrations for the namespace where the index is being built. This is done to ensure index consistency across shards, because if the migration already started and passed the point where it copied the collection indexes, any new index creation would leave the cluster with inconsistent indexes.

Additionally, on an empty collection, an index build executes a single phase build, which only calls the onCreateIndex observer.

Joining those two facts, we can see how we are missing aborting migrations in the onCreateIndex observer, which might cause inconsistent indexes across shards when an index creation is executed concurrently with a migration to a shard that previously did not have collection data. The file attached: migration_abort_index_creation.js contains a repro where a migration that should've been aborted, succeeds.



 Comments   
Comment by Githook User [ 17/Mar/23 ]

Author:

{'name': 'Marcos José Grillo Ramirez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-74449 Abort ongoin migrations on single phase builds

(cherry picked from commit ba69a854467a233ed235029441b8626825d81cfc)
Branch: v6.0
https://github.com/mongodb/mongo/commit/31b7922233ff1cd9a12b42203632c2022cb9aa28

Comment by Githook User [ 16/Mar/23 ]

Author:

{'name': 'Marcos José Grillo Ramirez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-74449 Abort ongoin migrations on single phase builds
Branch: master
https://github.com/mongodb/mongo/commit/ba69a854467a233ed235029441b8626825d81cfc

Generated at Thu Feb 08 06:27:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.