[SERVER-63129] Collection recreated on a dropped view namespace should be handled correctly on logical tenant collection cloner resume. Created: 31/Jan/22  Updated: 29/Oct/23  Resolved: 16/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0, 5.3.0-rc2, 5.2.2

Type: Bug Priority: Major - P3
Reporter: Suganthi Mani Assignee: Suganthi Mani
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
Related
related to SERVER-63764 fix macos dyld limit Closed
related to SERVER-80301 View/Timeseries recreated on a droppe... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.3, v5.2
Sprint: Server Serverless 2022-02-07, Server Serverless 2022-02-21
Participants:
Linked BF Score: 35

 Description   

1) Donor: Creates a view for ns db.coll. This in-turn does the following ops.

 - Create a collection db.system.views.
 - Insert a document w/ _id as db.coll into db.system.views collection.

2) Recipient primary: Start migration and clones db.system.views collection and replicates to secondaries.
3) Recipient secondary: Receives the insert to ns db.system.views oplog entry, this in-turn cause insert op-observer to register the view for the namespace specified in the _id field, (in this case, it's db.coll).
4) Donor: Drop the view db.coll and re-create a regular collection on ns db.coll.
5) Recipient's current primary steps down and fails over to new primary.
6) Recipient new primary: Starts migration and tenant cloner resumes and tries to clone the collection db.coll.

This would result the migration to fail due to collection cloner failure NamespaceExists w/ error message View already exists

Note: This problem applies only to tenant migration machinery not for logical initial initial sync as logical initial sync machinery doesn't have the capability to resume the database cloner.



 Comments   
Comment by Githook User [ 25/Feb/22 ]

Author:

{'name': 'Suganthi Mani', 'email': '38441312+smani87@users.noreply.github.com', 'username': 'smani87'}

Message: SERVER-63129 Tenant collection cloner resume should ignore “view already exists” errors while creating collections.

(cherry picked from commit e840bb65779035e3f5e7d1fb9b6951c291957a74)
Branch: v5.3
https://github.com/mongodb/mongo/commit/71d70bf5ebba88a8f51a20d660cb4d9c6532f35c

Comment by Githook User [ 16/Feb/22 ]

Author:

{'name': 'Suganthi Mani', 'email': '38441312+smani87@users.noreply.github.com', 'username': 'smani87'}

Message: SERVER-63129 Tenant collection cloner resume should ignore “view already exists” errors while creating collections.

(cherry picked from commit e840bb65779035e3f5e7d1fb9b6951c291957a74)
Branch: v5.2
https://github.com/mongodb/mongo/commit/30ed1fff8c2f672a31219cf3ae793f4cbc2260d6

Comment by Githook User [ 15/Feb/22 ]

Author:

{'name': 'Suganthi Mani', 'email': '38441312+smani87@users.noreply.github.com', 'username': 'smani87'}

Message: SERVER-63129 Tenant collection cloner resume should ignore “view already exists” errors while creating collections.
Branch: master
https://github.com/mongodb/mongo/commit/e840bb65779035e3f5e7d1fb9b6951c291957a74

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