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

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

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.2, 3.5.2
    • Affects Version/s: None
    • Component/s: 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

            Assignee:
            nathan.myers Nathan Myers
            Reporter:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: