[SERVER-47552] Unable to do point in time recovery using oplogReplay - Created: 15/Apr/20  Updated: 16/Apr/20  Resolved: 15/Apr/20

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

Type: Bug Priority: Major - P3
Reporter: Satvant Singh Assignee: Carl Champain (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

Step 1: mongorestore --port 27017 --nsInclude mydb1.mycoll ./ --drop

Step 2:  mongorestore --port 27017 --oplogReplay --oplogLimit 1586934385 ./

Participants:

 Description   

[root@************ local]# mongorestore --port 27017 --oplogReplay --oplogLimit 1586934385 ./
 2020-04-15T07:45:15.764+0000 preparing collections to restore from
 2020-04-15T07:45:15.764+0000 don't know what to do with file "oplog.rs.metadata.json", skipping...
 2020-04-15T07:45:15.764+0000 replaying oplog
 2020-04-15T07:45:18.067+0000 Failed: restore error: error applying oplog: applyOps: cannot apply insert or update operation on a non-existent namespace mydb.mycoll: { ts: Timestamp 1586931218000|1, h: 7203907580858761715, v: 2, op: "u", ns: "mydb.mycoll", o: { $set: { score: 10.0 }}, o2: { _id: ObjectId('5e96a22adf21792157ed2299') } }

 

 

I dropped "mydb.mycoll" earlier which is not require to me. 



 Comments   
Comment by Carl Champain (Inactive) [ 15/Apr/20 ]

Hi dba.satvant@gmail.com,

The error cannot apply insert or update operation on a non-existent namespace ... is typically the result of trying to do an oplog apply operation on top of an incomplete backup. The namespace in question was not part of the backup, thus the oplog apply operation complains that it was told to do some operation on a non-existent data.
To properly execute the --oplogReplay during restore, you need to run mongodump --oplog as detailed in Back Up and Restore with MongoDB Tools.

That said, the SERVER project is for bugs and feature suggestions for the MongoDB server. As this ticket does not appear to be a bug, I will now close it. If you need further assistance troubleshooting, I encourage you to ask our community by posting on the MongoDB Community Forums or on Stack Overflow with the mongodb tag.

Kind regards,
Carl

 

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