[SERVER-53861] Implement stop migrations procedure for DDL operations Created: 18/Jan/21  Updated: 29/Oct/23  Resolved: 25/Feb/21

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

Type: Task Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: PM-1965-Milestone-0, sharding-csrs-stepdown-also
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-54583 Relax implementation of getDatabaseWi... Closed
Related
related to SERVER-56227 Add user-facing command to set allowM... Closed
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 126

 Description   

Some DDL operations (drop collection, drop database, rename etc...) needs to freeze migrations in order to get a stable snapshot of all the shards that own chunks for a specific collection. Disabling the allowMigrations flag, is not enough, in fact when a DDL coordinator starts and you write the {allowMigrations:false}
flag on the config server, you could still have migration going from OldShard
-> NewShard. This migration definitely will fail to commit and NewShard won't
own any chunks, but NewShard will contain some garbage.

The following procedure will allow to safely prevent future migration to start and stop current ongoing migrations:

  1. Begin Transaction
  2. Set {allowMigrations:false}
  3. For one shard owning chunks, set shardVersion = collectionVersion + 1;
  4. Commit Transaction
  5. For each shard owning chunks: Refresh up to the new shardVersion from 3


 Comments   
Comment by Githook User [ 25/Feb/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-53861: Implement stop migrations procedure for DDL operations
Branch: master
https://github.com/mongodb/mongo/commit/1d3c1ca0ddb2c984ca66381cc39565cbec01c645

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