Skip to content

reserved_space larger than allocated entry error in write heavy scenarios #321

@alexghr

Description

@alexghr

I'm seeing these errors reserved_space larger than allocated entry 2 15 507 0 2 2 pop up in write heavy scenarios where I'm using lmdb in a queue-like fashion. Eventually this leads to a crash in the process where it can't write to the underlying database anymore.

I have prepared this isolated test case that's exhibiting the same behaviour alexghr/reserved_space_error and I'd be interested if anyone has any insights into what I'm doing wrong here (or ideas to debug this further).

I have tested this both on Node 18.19 (old LTS) and 22.12 (current) on my PC running Linux.

One workaround I have found is to delete items one-by-one instead of batches of 100 items at a time (ie. use asyncPool(1, ...) on this line in test.mjs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions