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

Implement stop migrations procedure for DDL operations

    • 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:

      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

            Assignee:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Reporter:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: