[SERVER-9264] Repair process fails with a mount folder volume on Windows Created: 05/Apr/13  Updated: 10/Dec/14  Resolved: 05/Apr/13

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

Type: Bug Priority: Minor - P4
Reporter: David Verdejo Assignee: A. Jesse Jiryu Davis
Resolution: Duplicate Votes: 0
Labels: error, folder, mounted, repair, windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

db version v2.4.1
build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49


Attachments: PNG File mongo_mount_folder.PNG     Text File repair_error_mount_folder.txt    
Issue Links:
Duplicate
duplicates SERVER-1379 dropdb with directoryperdb should rem... Closed
Related
is related to SERVER-9271 Failed to allocate new file on a data... Closed
Operating System: ALL
Steps To Reproduce:

1) Start a mongod instance with dbpath: "E:\mongodb\data\db" and directoryperdb: true parameters.
2) Create a database "cacheagg", insert some data and stop instance
3) Rename folder "E:\mongodb\data\db\cacheagg" to "E:\mongodb\data\db\cacheagg_migrate"
3) Create a mounted folder on "E:\mongodb\data\db\cacheagg"
4) Move all files from "E:\mongodb\data\db\cacheagg_migrate" to "E:\mongodb\data\db\cacheagg"
5) Start instance and you review that everything is ok and then stop instance
6) Start repair process
options:

{ auth: true, dbpath: "E:\mongodb\data\db", directoryperdb: true, keyFile: "C:\mongodb\bin\keyfilecacheagg.txt", logpath: "E:\mongodb\log\mongo.log", repair: true, repairpath: "E:\mongodb\data\db\mongodb_repair" }
Participants:

 Description   

We create use a mounted folder on Windows to use a database on a different volume for improve performance disk.
I tried to use repair option, the repair process fails with a error to access to the mounted folder (see logs).



 Comments   
Comment by A. Jesse Jiryu Davis [ 05/Apr/13 ]

Unfortunately repairDatabase and --directoryperdb are not supported together when the databases' directories are mount points. While waiting for this feature to be implemented, you can engage in the following:

1. Use the shell command like:

> // switch to the db you want to repair
> use cacheagg
> db.runCommand({repairDatabase: 1})

2. mongod makes compacted copy of files at E:\mongodb\data\db_tmp_repairDatabase_0, then asserts

3. shut down mongod

4. Manually copy the files from E:\mongodb\data\db_tmp_repairDatabase_0 to E:\mongodb\data\db\cacheagg

5. Restart mongodb

6. Optionally delete repaired files from E:\mongodb\data\db_tmp_repairDatabase_0

Clearly, using repairDatabase with --directoryperdb and mount points will be better once SERVER-1379 is complete; in particular you'll be able to start mongod with --repair and specify a repairpath.

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