Core Server
  1. Core Server
  2. SERVER-4266

Need to support --repairpath outside of --dbpath with journaling on

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Critical - P2 Critical - P2
    • Resolution: Unresolved
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.7 Desired
    • Component/s: Stability, Storage
    • Environment:
      2.0.1 binaries (64 bit) on Windows 7 x64
    • Backport:
      No
    • Operating System:
      ALL
    • # Replies:
      3
    • Last comment by Customer:
      true
    • Driver changes needed?:
      No driver changes needed

      Description

      Start a new database, insert 1 document in it. Now shutdown the database and run mongod --repair --repairpath <>. This immediately crashes with
      c:\mongo\mongodb-win32-x86_64-2.0.1\bin>mongod.exe --repair --repairpath c:\data\repair
      Fri Nov 11 13:28:10 [initandlisten] MongoDB starting : pid=7752 port=27017 dbpath=/data/db 64-bit host=Sridhar-PC
      Fri Nov 11 13:28:10 [initandlisten] db version v2.0.1, pdfile version 4.5
      Fri Nov 11 13:28:10 [initandlisten] git version: 3a5cf0e2134a830d38d2d1aae7e88cac31bdd684
      Fri Nov 11 13:28:10 [initandlisten] build info: windows (6, 1, 7601, 2, 'Service Pack 1') BOOST_LIB_VERSION=1_42
      Fri Nov 11 13:28:10 [initandlisten] options:

      { repair: true, repairpath: "c:\data\repair" }

      Fri Nov 11 13:28:10 [initandlisten] journal dir=/data/db/journal
      Fri Nov 11 13:28:10 [initandlisten] recover : no journal files present, no recovery needed
      Fri Nov 11 13:28:11 [initandlisten] ****
      Fri Nov 11 13:28:11 [initandlisten] ****
      Fri Nov 11 13:28:11 [initandlisten] need to upgrade database test with pdfile version 4.5, new version: 4.5
      Fri Nov 11 13:28:11 [initandlisten] starting upgrade
      Fri Nov 11 13:28:11 [initandlisten] test repairDatabase test
      Fri Nov 11 13:28:11 [initandlisten] removeJournalFiles
      Fri Nov 11 13:28:11 [initandlisten] warning file is not under db path? c:/data/repair/$tmp_repairDatabase_3/test /data/d
      b
      Fri Nov 11 13:28:11 [initandlisten] warning file is not under db path? c:/data/repair/$tmp_repairDatabase_3/test.ns /dat
      a/db
      Fri Nov 11 13:28:11 [initandlisten] warning file is not under db path? c:/data/repair/$tmp_repairDatabase_3/test /data/d
      b
      Fri Nov 11 13:28:11 [initandlisten] warning file is not under db path? c:/data/repair/$tmp_repairDatabase_3/test.0 /data
      /db
      Fri Nov 11 13:28:11 [initandlisten] build index test.foo

      { _id: 1 }

      Fri Nov 11 13:28:11 [initandlisten] build index done 1 records 0.005 secs
      Fri Nov 11 13:28:11 [initandlisten] Assertion failure _recovering db\dur_recover.cpp 235
      Fri Nov 11 13:28:11 [initandlisten] dbexception in groupCommit causing immediate shutdown: 0 assertion db\dur_recover.cp
      p:235
      Fri Nov 11 13:28:11 gc1

      Note: If you run mongod --repair --repairpath --nojournal this does not occur

        Issue Links

          Activity

          Hide
          Mathias Stearn
          added a comment - - edited

          I have reproduced this. It looks like journaling doesn't work well with files outside of --dbpath, which --repairpath is likely to use. A quick-fix would be to disallow --repairpath when using --journaling. A proper fix would likely take a day or two to get right.

          Edit: to be clear, as a workaround, you can mount (or symlink to) your --repairpath volume in a subdirectory under --dbpath. For example: mongod --dbpath /data/db --repairpath /data/db/_repairPath

          Show
          Mathias Stearn
          added a comment - - edited I have reproduced this. It looks like journaling doesn't work well with files outside of --dbpath, which --repairpath is likely to use. A quick-fix would be to disallow --repairpath when using --journaling. A proper fix would likely take a day or two to get right. Edit: to be clear, as a workaround, you can mount (or symlink to) your --repairpath volume in a subdirectory under --dbpath. For example: mongod --dbpath /data/db --repairpath /data/db/_repairPath
          Hide
          Ian Daniel
          added a comment -

          A use case that this bug disallows is when the user is low on disk space and wants to repair, and brings in temporary disk for the repairpath.

          Show
          Ian Daniel
          added a comment - A use case that this bug disallows is when the user is low on disk space and wants to repair, and brings in temporary disk for the repairpath.
          Hide
          Ernie Hershey
          added a comment -

          We just hit this today working on MCI data. We're using the symlink workaround.

          Our use case is exactly that - we're running low on space, added a new drive to use for the repair, and can't use it without symlinking into the data directory.

          Show
          Ernie Hershey
          added a comment - We just hit this today working on MCI data. We're using the symlink workaround. Our use case is exactly that - we're running low on space, added a new drive to use for the repair, and can't use it without symlinking into the data directory.

            People

            • Votes:
              9 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since reply:
                20 weeks, 6 days ago
                Date of 1st Reply: