-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large database truncate problem #37
Comments
Could it be file fragmentation? Googling this message finds this: https://support.assurestor.com/support/solutions/articles/16000104076-the-requested-operation-could-not-be-completed-due-to-a-file-system-limitation
|
Thanks for the bug report.
Segment files can't exceed 4GiB https://github.com/akrylysov/pogreb/blob/master/options.go#L40. The max segment size currently is not configurable and is always set to 4GiB. main.pix is the main index file. Index files use 64-bit offsets: Line 89 in cc107cd
Windows support could definitely use more testing. I develop Pogreb on macOS and deploy it to Linux. I'll try to reproduce the issue. Wondering if it's related to mmap? I'm working on adding an option to disable mmap. |
I can reproduce the error - anytime if err := f.Truncate(off + int64(size)); err != nil { I've added logging: fmt.Printf("Error offset %d size %d from f.Trunacte: %s\n", off, size, err.Error()) And the output is always:
The offset number is in sync with the file size (37.3 GB). I tried the defragmentation tool of Windows without success (I assume due to SSD it actually didn't defrag). Then I tried another trick - copying So it looks like the underlying error is that when you extend it by 512 times NTFS extends it by millions of chunks (instead of consecutive data) - and at some point it hits an OS internal limit. I will monitor the situation and check if it fails again in 40 GB (which might take weeks). I guess an ugly fix would be catching that error and then temporarily closing the file, and doing what I did manually - copy, delete old, rename, open. Microsoft documented the problem here: https://support.microsoft.com/en-in/help/967351/a-heavily-fragmented-file-in-an-ntfs-volume-may-not-grow-beyond-a-cert |
We are recently running into this problem which prevents the database from growing. Every time we call
db.Put
we get this error message:The whole database folder is 255 GB. The file
main.pix
is 37.3 GB of size. Running on Windows Server 2019 as admin and the disk has plenty of storage (4 TB total).Any idea of the root cause and how to fix it?
I suppose the error message origins from here?
pogreb/file.go
Lines 79 to 86 in e182fb0
Edit: Unrelated to this problem, but in
truncate
used byrecoveryIterator.next
it uses uint32. That could lead to problems down the road for large segment files?pogreb/file.go
Lines 97 to 107 in e182fb0
The text was updated successfully, but these errors were encountered: