[SERVER-61256] Allow a shardsvr tenant migration recipient to create collections directly on itself Created: 04/Nov/21  Updated: 29/Oct/23  Resolved: 11/Nov/21

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

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Sophia Tan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2021-11-15
Participants:

 Description   

On shardsvr replica sets, the ShardServerOpObserver throws  CannotImplicitlyCreateCollection when creating a new collection unless the OperationShardingState has _allowCollectionCreation set to true.

(OperationShardingState is a decoration on the OperationContext; see here for more about decorations.)

This is so that we as developers are aware of all places collection creation can occur, verify they are synchronized with the database critical section, and explicitly enable them using this guard.

This ticket is to add the guard where the tenant migration recipient creates collections during the bulk clone (similar to the guard where the moveChunk recipient creates collections), so that we can run tenant migrations on shardsvrs.

This ticket should add a test that a tenant migration succeeds when there is pre-existing data for the tenant on the donor. 



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

Author:

{'name': 'Sophia Tan', 'email': 'sophia_tll@hotmail.com', 'username': 'sophiatll'}

Message: SERVER-61256 Allow a shardsvr tenant migration recipient to create collections directly on itself
Branch: master
https://github.com/mongodb/mongo/commit/84d485c25a0d238467048200bb7e894ada67bedc

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