Skip to content

Large database truncate problem #37

@Kleissner

Description

@Kleissner

We are recently running into this problem which prevents the database from growing. Every time we call db.Put we get this error message:

truncate D:\Database\main.pix: The requested operation could not be completed due to a file system limitation

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

func (f *file) extend(size uint32) (int64, error) {
off := f.size
if err := f.Truncate(off + int64(size)); err != nil {
return 0, err
}
f.size += int64(size)
return off, f.Mmap(f.size)
}

Edit: Unrelated to this problem, but in truncate used by recoveryIterator.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

func (f *file) truncate(size uint32) error {
// Truncating memory-mapped file will fail on Windows. Unmap it first.
if err := f.Mmap(0); err != nil {
return err
}
if err := f.Truncate(int64(size)); err != nil {
return err
}
f.size = int64(size)
return f.Mmap(f.size)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions