[SERVER-11166] Database disappeared after running db.repairDatabase() on a cloned database from existing instance to a new instance. Created: 13/Oct/13  Updated: 09/Jul/16  Resolved: 04/Jun/14

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

Type: Bug Priority: Critical - P2
Reporter: Rydal Assignee: Ramon Fernandez Marina
Resolution: Done Votes: 0
Labels: Windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7


Operating System: Windows
Steps To Reproduce:

Clone database from a different instance
Try to repair clone

Participants:

 Description   

Luckily I was testing in development environment when this happened but I completely lost 2 databases in the middle of a repair when it crashed with the following error message.

exception in initAndListen: 14043 clear tmp files caught exception exception: boost::filesystem::status: Access is denied: "F:\Temp\mongodb-win32-x86_64-2.4.7-rc0\data_tmp", terminating

Anyway, after some digging, since I just installed the new instance so I can simulate cloning database before doing so in production, I realized that the instance didn't have write permission to that folder so it just quit without creating the new files on repair. I also noticed that database files were actually in tmp* folders but didn't touch them as I wasn't too sure if they were corrupted or not.

What baffled me though is, the instance was able to create _tmp folders but not folders to create databases within the same directory, I would think it will fail completely on everything that needed create permission.

Anyway, by simply giving it all access "everything" permissions to that folder and retrying everything worked as expected.

I'll suggest that this is documented or at least the internal code should run a quick test before starting the repair process and failing later. I'm sure someone is going to try it in production before testing and blow out databases as I almost did.

As always, love MongoDB, thanks team MongoDB.



 Comments   
Comment by Ramon Fernandez Marina [ 04/Jun/14 ]

Hi Rydal,

I haven't heard back from you for some time, so I'm going to mark this ticket as resolved. If this is still an issue for you please feel free to re-open the ticket and provide the information requested by Stephen.

Regards,
Ramón.

Comment by Ramon Fernandez Marina [ 20/May/14 ]

Hi Rydal,

is this still an issue for you? If so, can you please provide the information Stephen requested?

Regards,
Ramón.

Comment by Stennie Steneker (Inactive) [ 16/Dec/13 ]

Hi,

Can you please clarify the steps to reproduce this issue?

  • By "cloning" the database do you mean that you copied the files, ran the db.cloneDatabase() command, or took some other action?
  • When mongod quit due to the access denied exception, did it remove your original database even though the repair aborted?
  • Can you confirm the exact permissions that were on the data directory before you corrected them?
  • Is there anything special about how the data directory is mounted? (i.e. is it a normal directory on local drive, network drive, subst, ... ?)

Thanks,
Stephen

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