[SERVER-54981] Improve ability to test resharding's DonorStateMachine from C++ Created: 05/Mar/21  Updated: 29/Oct/23  Resolved: 11/Mar/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Fixed Votes: 0
Labels: PM-234-M3, PM-234-T-lifecycle
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-55288 Improve ability to test resharding's ... Closed
related to SERVER-55682 Improve ability to test ReshardingCoo... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2021-03-22
Participants:
Story Points: 2

 Description   

This involves doing the following:

  • Generalizing the PrimaryOnlyServiceTest fixture from primary_only_service_test.cpp.
  • Moving DonorStateMachine methods which access Grid and CatalogCacheLoader behind a DonorStateMachineExternalState interface.
  • Adding a recipientShardIds field to TypeCollectionDonorFields.
    1. Coordinator's transition to kInitializing would do insert to config.reshardingOperations and update to config.collections entry for original namespace to set allowMigrations=false and reshardingFields.uuid and reshardingFields.state. It wouldn't fill in the reshardingFields.donorFields for the original namespace yet.
    2. Coordinator's transition to kPreparingToDonate would do update to config.reshardingOperations, insert to config.collections, config.chunks, and config.tags for temporary resharding namespace, and update to config.collections entry for original namespace to set reshardingFields.donorFields.
  • Updating verifyValidReshardingFields() to (1) correct the xor logic and (2) special case kInitializing to say there should be neither donorFields nor recipientFields.


 Comments   
Comment by Githook User [ 11/Jun/21 ]

Author:

{'name': 'Kshitij Gupta', 'email': 'kshitij.gupta@mongodb.com', 'username': 'kshitijng'}

Message: SERVER-55818: Creating a ReshardingCoordinatorServiceTest fixture analogous to the ReshardingDonorServiceTest fixture from SERVER-54981.

(cherry picked from commit 1c40ecd40f8f2c9501d0a0e78e6dee3a5b6a49b6)
Branch: v5.0
https://github.com/mongodb/mongo/commit/559221653999ec848ea95bac6ea4390b81802d39

Comment by Githook User [ 03/Jun/21 ]

Author:

{'name': 'Kshitij Gupta', 'email': 'kshitij.gupta@mongodb.com', 'username': 'kshitijng'}

Message: SERVER-55818: Creating a ReshardingCoordinatorServiceTest fixture analogous to the ReshardingDonorServiceTest fixture from SERVER-54981.
Branch: master
https://github.com/mongodb/mongo/commit/1c40ecd40f8f2c9501d0a0e78e6dee3a5b6a49b6

Comment by Githook User [ 11/Mar/21 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-54981 Decouple DonorStateMachine unit testing from sharding env.
Branch: master
https://github.com/mongodb/mongo/commit/79488ecf9938d897e38d3f8eebc3d9f762483b91

Comment by Githook User [ 09/Mar/21 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-54981 Add recipientShards field to resharding donor document.

Changes "reshardingFields.donorFields" to be filled in as part of the
coordinator's transition to kPreparingToDonate.
Branch: master
https://github.com/mongodb/mongo/commit/8f5b19480757929c98a5d7675c4c1762b32b09e9

Comment by Githook User [ 09/Mar/21 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-54981 Create PrimaryOnlyServiceMongoDTest fixture.
Branch: master
https://github.com/mongodb/mongo/commit/c67e7427ed4d94268b62f5322686e2af0bbaa9fa

Generated at Thu Feb 08 05:35:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.