Skip to content

LMDB MDB_BAD_VALSIZE / mdb_page_alloc error under sharded blob write load #689

Description

@kriszyp

Problem

During blob write stress tests on a sharded cluster, LMDB fails with MDB_BAD_VALSIZE and related page allocation errors, ultimately causing an uncaught commit exception.

Log sequence:

Read transaction detected that has been open too long (over 15 minutes), ending transaction
Invalid zero size key
mdb_page_alloc error
mdb_page_touch error
cursor_del0 failed, -30781
Error: MDB_BAD_VALSIZE: Unsupported size of key/DB name/data, or wrong DUPFIXED size: Attempting to delete free-space record
  code: -30781

Relation

Part of a cluster of LMDB freelist failures under sharding write load:

All three share the same reproduction path (sharded-blob-test, multiRightWrites.js, multi-node cluster). The stale read transaction noted in logs likely contributes by preventing freelist page recycling, leading to state corruption.

Reproduction

https://github.com/HarperDB/sharded-blob-testmultiRightWrites.js and singleBlobWrites.js. Reproduced on both 4.5.9 and 4.6.0-alpha.3.

🤖 Filed by Claude on behalf of Kris.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:storageStorage engine, LMDB/RocksDB, compactionbugSomething isn't workingduplicateThis issue or pull request already existsfrom-jiraMigrated or originated from a Jira ticket

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions