Introduce a commitChunkMigration command, only available on the config server, with the following arguments:
- migratedChunk (bson) - complete description of a chunk, which is being migrated.
- controlChunk (bson, optional) - complete description of a chunk owned by the same shard as the migrated chunk, but which does not move. This value will be missing if the migrateChunk is the last chunk being moved off a given shard.
- newShard (string) - name of a shard to which the migratedChunk is being moved.
This command internally, using a centralized version generation source will produce a new chunk version to be used for the migrated and control chunks, similarly to the logic that is currently used, and updates the config.chunks collection with the new versions, encompassing the writes performs as part of ‘applyOps’ today. Additionally it will return a bson response with the following contents:
- migratedChunkVersion - newly generated version for the migrated chunk
- controlChunkVersion - newly generated version for the control chunk
One thing to be considered is whether this command should only be made available if the server is running in config server mode.
- depends on
-
SERVER-24443 Add repl::ReadConcernArgs to Shard::exhaustiveFindOnConfig
- Closed
- has to be done before
-
SERVER-24413 Send ChunkVersions with the CommitChunkMigration command, which will then check them
- Closed
-
SERVER-24397 Refactor and improve applyChunkOpsDeprecated
- Closed
- is depended on by
-
SERVER-23678 Cached minor shard version does not match that of the persistent config metadata after moveChunk
- Closed
- related to
-
SERVER-24031 Prevent cleanupOrphan from deleting migrating chunk data before commit
- Closed