[SERVER-52727] Handle cloneCollectionAsCapped and convertToCapped during tenant migrations Created: 09/Nov/20  Updated: 05/Dec/22  Resolved: 17/Nov/20

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

Type: Task Priority: Major - P3
Reporter: Jason Zhang Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Do Votes: 0
Labels: pm-1791_milestone-A
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-52981 Complete TODO listed in SERVER-52727 Closed
Assigned Teams:
Sharding
Participants:

 Description   

cloneCollectionAsCapped creates a new capped collection and puts the data from an existing collection into it. It generates multiple oplog entries: first an oplog entry to create the new capped collection, then individual oplog entries to insert documents from the existing collection into the new capped collection.

convertToCapped uses cloneCollectionAsCapped's machinery to create a new capped collection and put data from an existing collection into it, then rename the new capped collection over the existing collection. So, it also generates the same oplog entries as cloneCollectionAsCapped, plus an oplog entry for the rename.

Currently, it's possible for a tenant migration to start blocking after cloneCollectionAsCapped or convertToCapped have written only some of their oplog entries. The operations will fail but leave the capped collection around as garbage on the donor, and the recipient will have the capped collection as garbage as well.

I think it's also possible for this garbage to be created if a stepdown happens during cloneCollectionAsCapped or convertToCapped today.
 



 Comments   
Comment by Githook User [ 17/Nov/22 ]

Author:

{'name': 'Esha Maharishi', 'email': 'esha.maharishi@mongodb.com', 'username': 'EshaMaharishi'}

Message: SERVER-52981 Complete TODO listed in SERVER-52727
Branch: master
https://github.com/mongodb/mongo/commit/a436845349b9d52bb54febf03614f540250202a4

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