[SERVER-26562] Move CommitChunkMigration command implementation into a Catalog function and unit test it Created: 10/Oct/16  Updated: 05/Apr/17  Resolved: 09/Dec/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.4.2, 3.5.2

Type: Task Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Nathan Myers
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.4
Sprint: Sharding 2016-10-31, Sharding 2016-11-21, Sharding 2016-12-12, Sharding 2017-01-02
Participants:

 Description   

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


 Comments   
Comment by Githook User [ 20/Jan/17 ]

Author:

{u'username': u'nathan-myers-mongo', u'name': u'Nathan Myers', u'email': u'nathan.myers@10gen.com'}

Message: SERVER-26562 Unit tests for commitChunkMigration

(cherry picked from commit 9b403d89bb81064a9d4813724d075c51b0121e97)
(cherry picked from commit 03670b56b84bd67356d391e474d1a26b8e1acb9f)
(cherry picked from commit b5fedd38b03e5d787fc4322a28e12aa38a3d3dc8)
Branch: v3.4
https://github.com/mongodb/mongo/commit/30ac354f3e2bc67a35f769b13c5c5bbef3b244ff

Comment by Nathan Myers [ 12/Dec/16 ]

Improve testing of 3.4 releases.

Comment by Githook User [ 08/Dec/16 ]

Author:

{u'username': u'nathan-myers-mongo', u'name': u'Nathan Myers', u'email': u'nathan.myers@10gen.com'}

Message: SERVER-26562 Unit tests for commitChunkMigration
Branch: master
https://github.com/mongodb/mongo/commit/b5fedd38b03e5d787fc4322a28e12aa38a3d3dc8

Comment by Githook User [ 05/Dec/16 ]

Author:

{u'username': u'Machyne', u'name': u'Matt Cotter', u'email': u'matt.cotter@mongodb.com'}

Message: SERVER-26562 fix lint
Branch: master
https://github.com/mongodb/mongo/commit/03670b56b84bd67356d391e474d1a26b8e1acb9f

Comment by Githook User [ 05/Dec/16 ]

Author:

{u'username': u'nathan-myers-mongo', u'name': u'Nathan Myers', u'email': u'nathan.myers@10gen.com'}

Message: SERVER-26562 Move CommitChunkMigration cmd impl to catalog, prep for unit tests
Branch: master
https://github.com/mongodb/mongo/commit/9b403d89bb81064a9d4813724d075c51b0121e97

Comment by Nathan Myers [ 23/Nov/16 ]

We will remove the MoveChunkRequest::_takeDistLock member and corresponding arguments and message fields for 3.5 after completing the backport to 3.4. Includes CommitChunkMigrationRequest::appendAsCommand argument shardHasDistributedLock.

Generated at Thu Feb 08 04:12:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.