[SERVER-80301] View/Timeseries recreated on a dropped regular collection namespace can cause tenant migration/logical initial sync to fail with 'commandNotSupportedOnView' Created: 22/Aug/23  Updated: 29/Oct/23  Resolved: 24/Aug/23

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

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

Attachments: File SERVER-80301_repro.js    
Issue Links:
Depends
is depended on by SERVER-79482 Tenant migration/merge and split pass... Closed
Related
is related to SERVER-63129 Collection recreated on a dropped vie... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution NAMR Team 2023-09-04
Participants:

 Description   

Any data migration protocol that applies oplog entries on inconsistent snapshot (i.e, not a stable recovery), then the following sequence could cause the data migration to fail with error ErrorCodes::commandNotSupportedOnView - Namespace <xxxx> is a view, not a collection

1) Sync source: Create a regular collection on nss db.coll at TS(100).
2) SyncTarget: Starts the logical cloning with beginApplyingTimestamp as TS(110).
3) Sync source: Inserts an entry into collection db.foo at TS(120).
4) Sync source: Drop collection db.foo at TS(130).
5) Sync Source: creates a view on dropped collection nss db.coll at TS(140).
6) SyncTarget: Database Cloner clones database 'db'. And, that results in copying db.system.views collection which would register the view on nss db.coll.
7) SyncTarget: Finishes cloning and starts applying the oplog entries from TS(110) to TS(140) to make the data consistent.
8) SyncTarget: Now, on trying to apply TS(120), the oplog applier will fail with CommandNotSupportedOnView.

To fix this issue, we should just ignore CommandNotSupportedOnView error for oplog application mode kInitialSync and for kUnstableRecovering. To be noted, both logical initial sync and tenant migration uses oplog application mode kInitialSync .

Note: I have attached a tenant migration repro for this bug.



 Comments   
Comment by Githook User [ 24/Aug/23 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-80301 Ignore CommandNotSupportedOnView error for oplog application modes kInitialSync and kUnstableRecovering
Branch: master
https://github.com/mongodb/mongo/commit/708bd70c8f7000ea325845286f4b97fb8227d45c

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