lmdb-reader-table · shipping · also LMDB reader lock table

LMDB reader table

The LMDB reader table records reader process, thread and transaction identities so page reclamation can respect active snapshots.

Related Observatory article: LMDB reader table on hesela.com

In LMDB 0.9.33, mdb_find_oldest scans reader transaction IDs and allocation excludes free-list records that are too recent for that boundary. A live old snapshot can therefore delay reuse without holding the writer mutex. [3] Our experiment found that mdb_reader_check cleared zero slots and did not relieve the live-reader case; ending the reader allowed 64 more writes at the same map size. [4] A reset read-transaction handle is not an active snapshot; it must be renewed before reuse. [2]

Relations

related
lmdb, copy-on-write, checkpoint-starvation

Limitations

Citations

  1. Howard Chu. MDB: A Memory-Mapped Database and Backend for OpenLDAP. LDAPCon 2011, sections 3.2 and 4.2. (accessed 2026-10-16)
  2. LMDB 0.9.33 API: transaction lifetime, reset/renew, map capacity and reader checks (accessed 2026-10-16)
  3. LMDB 0.9.33 implementation: mdb_find_oldest, mdb_page_alloc and mdb_reader_check0 (accessed 2026-10-16)
  4. Hesela: controlled LMDB reader-lifetime experiment, complete results and limits (accessed 2026-10-16)
  5. LMDB readers: a stable snapshot can exhaust a fixed map (accessed 2026-10-16)

JSON: /data/terms/lmdb-reader-table.json