[SERVER-11904] Preallocated files are sparse in FreeBSD/UFS Created: 30/Nov/13 Updated: 11/Jul/16 Resolved: 27/Dec/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Taha Jahangir | Assignee: | Davide Italiano |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
FreeBSD 9.1/9.2 amd64, mongodb 2.4.8 |
||
| Operating System: | FreeBSD |
| Steps To Reproduce: | Reproducible with clean installation of FreeBSD + mongo |
| Participants: |
| Description |
|
Title is clear, allocating 2GB files takes no time / no space on disk, and thus disk fragmentation can occur.
|
| Comments |
| Comment by Davide Italiano [ 23/Dec/13 ] |
|
A patch has been just committed that should fix this problem. This will be available in 2.6 (but can be tested with the current 2.5.x nightly) |
| Comment by Githook User [ 23/Dec/13 ] |
|
Author: {u'username': u'dcci', u'name': u'Davide Italiano', u'email': u'davide.italiano@10gen.com'}Message: |
| Comment by Taha Jahangir [ 02/Dec/13 ] |
|
No, I'm not a FreeBSD guru, but I think the files should not be sparse unless explicitly specified in creation time. And I don't what is actually called by mongodb to preallocate files. If we have a simple c file with few lines of code, that simulates the file preallocator process, we could debug the FreeBSD part. And I noticed that in file_allocator.cpp, there is a useSparseFiles method that returns true in FreeBSD!, but in FileAllocator::ensureLength it seems the that return value of useSparseFiles is false (because not log about sparse file is printed) |
| Comment by Eliot Horowitz (Inactive) [ 02/Dec/13 ] |
|
Do you have a link to how their sparse is implemented? |