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

Move CommitChunkMigration command implementation into a Catalog function and unit test it



    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.4.2, 3.5.2
    • Sharding
    • None
    • Fully Compatible
    • v3.4
    • Sharding 2016-10-31, Sharding 2016-11-21, Sharding 2016-12-12, Sharding 2017-01-02


      While working on SERVER-25875, it became evident that to adequately test the CommitChunkMigration command with JS testing requires cumbersome failpoint additions. Continuing to add failpoints would make future changes increasingly difficult. Unit testing is far more appropriate in this case than adding failpoints and JS test setup in order to mimic unit testing.

      As part of this ticket, the code from the CommitChunkMigration command should be moved to be a commitChunkMigration method on ShardingCatalogManager with the following parameters:

      • Collection namespace
      • Migrated chunk - ChunkType
      • Control chunk (optional) - ChunkType
      • From shard - ShardId
      • To shard - ShardId

      The current parameters fromShardCollectionVersion and shardHasDistributedLock will be removed in place of the exact chunk version being transmitted and the newly written unit-tests.

      In addition to the change above, unit-tests must be implemented similar to what we do for split and merge. The following test case should be included:

      • Correctly migrating a chunk
      • Correctly migrating the last chunk from a shard (i.e., there is no control chunk)
      • The expected chunk version does not match
      • The expected chunk epoch does not match
      • The from shard does not match




            nathan.myers Nathan Myers
            dianna.hohensee@mongodb.com Dianna Hohensee
            0 Vote for this issue
            4 Start watching this issue