{
  "slug": "lmdb-reader-table",
  "term": "LMDB reader table",
  "aliases": [
    "LMDB reader lock table"
  ],
  "definition": "The LMDB reader table records reader process, thread and transaction identities so page reclamation can respect active snapshots.",
  "note": "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. [implementation] 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. [hesela-observation] A reset read-transaction handle is not an active snapshot; it must be renewed before reuse. [api]",
  "related": [
    "lmdb",
    "copy-on-write",
    "checkpoint-starvation"
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "Map capacity, reusable pages and live payload bytes are different quantities; these test counts are not universal thresholds.",
      "citationIds": [
        "hesela-observation"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-16",
  "citations": [
    {
      "id": "chu",
      "title": "Howard Chu. MDB: A Memory-Mapped Database and Backend for OpenLDAP. LDAPCon 2011, sections 3.2 and 4.2.",
      "url": "https://www.openldap.org/pub/hyc/mdb-paper.pdf",
      "accessed": "2026-10-16"
    },
    {
      "id": "api",
      "title": "LMDB 0.9.33 API: transaction lifetime, reset/renew, map capacity and reader checks",
      "url": "https://github.com/LMDB/lmdb/blob/3a29a24777c82a0165de813ae696a5068b5add30/libraries/liblmdb/lmdb.h",
      "accessed": "2026-10-16"
    },
    {
      "id": "implementation",
      "title": "LMDB 0.9.33 implementation: mdb_find_oldest, mdb_page_alloc and mdb_reader_check0",
      "url": "https://github.com/LMDB/lmdb/blob/3a29a24777c82a0165de813ae696a5068b5add30/libraries/liblmdb/mdb.c",
      "accessed": "2026-10-16"
    },
    {
      "id": "hesela-observation",
      "title": "Hesela: controlled LMDB reader-lifetime experiment, complete results and limits",
      "url": "https://hesela.dev/research/lmdb-reader-lifetime.json",
      "accessed": "2026-10-16"
    },
    {
      "id": "hesela-analysis",
      "title": "LMDB readers: a stable snapshot can exhaust a fixed map",
      "url": "https://hesela.com/analyses/lmdb-readers-page-reuse-map-full/",
      "accessed": "2026-10-16"
    }
  ]
}
