Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11166

Database disappeared after running db.repairDatabase() on a cloned database from existing instance to a new instance.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Gone away
    • Affects Version/s: 2.4.7
    • Fix Version/s: None
    • Component/s: Internal Code
    • Labels:
    • Environment:
      Windows 7
    • Operating System:
      Windows
    • Steps To Reproduce:
      Hide

      Clone database from a different instance
      Try to repair clone

      Show
      Clone database from a different instance Try to repair clone

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: