-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Sharding
-
Fully Compatible
-
126
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:
- Begin Transaction
- Set {allowMigrations:false}
- For one shard owning chunks, set shardVersion = collectionVersion + 1;
- Commit Transaction
- For each shard owning chunks: Refresh up to the new shardVersion from 3
- is depended on by
-
SERVER-54583 Relax implementation of getDatabaseWithRefresh/getCollectionRoutingInfoWithRefresh of the CatalogCache
- Closed
- related to
-
SERVER-56227 Add user-facing command to set allowMigrations to false for a sharded collection
- Closed