https://bugs.openldap.org/show_bug.cgi?id=10643
Issue ID: 10643 Summary: DUPSORT page counts remain inflated after deleting a duplicate tree Product: LMDB Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: liblmdb Assignee: bugs@openldap.org Reporter: ledvinap@gmail.com Target Milestone: ---
b048b7e (ITS#9388) updates the parent’s page counts only when the duplicate child tree still contains entries. Whole-set deletion and deletion of the last value skip adjustment.
Fix: subtract counts still in NODEDATA(leaf) after successful mdb_drop0().
AI discovery/fix; This report is fully authored by me.
https://bugs.openldap.org/show_bug.cgi?id=10643
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |TEST Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Howard Chu hyc@openldap.org --- Fixed in git f437e48ccf4273c3a0c7aa3c9af84e04f8155e98
https://bugs.openldap.org/show_bug.cgi?id=10643
--- Comment #2 from ledvinap@gmail.com --- I'm afraid that f437e48ccf4273c3a0c7aa3c9af84e04f8155e98 won't work for 'delete last duplicate' case:
mdb_cursor_del(parent) - mdb_cursor_del(child) - mdb_cursor_del0(child) - mdb_rebalance(child)
mdb_rebalance(): if (NUMKEYS(mp) == 0) { mc->mc_db->md_leaf_pages = 0;
Reusing original header from NODEDATA(leaf) handles both cases.
https://bugs.openldap.org/show_bug.cgi?id=10643
--- Comment #3 from Howard Chu hyc@openldap.org --- I see. OK, fixed again in ba47717cc87753f86f24135c17bfaaa82d5daf53
https://bugs.openldap.org/show_bug.cgi?id=10643
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@openldap.org |hyc@openldap.org Keywords|needs_review | Target Milestone|--- |0.9.37
https://bugs.openldap.org/show_bug.cgi?id=10643
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|0.9.37 |0.9.36
https://bugs.openldap.org/show_bug.cgi?id=10643
--- Comment #4 from Quanah Gibson-Mount quanah@openldap.org --- mdb.master:
f3f427ff by Howard Chu at 2026-10-19T17:40:57+01:00
ITS#10643 lmdb: fix page counts when deleting DUPSORT record
mdb.RE/0.9:
d0324e4f by Howard Chu at 2026-10-19T17:41:20+01:00
ITS#10643 lmdb: fix page counts when deleting DUPSORT record
mdb.master3:
f437e48c by Howard Chu at 2026-10-19T17:40:01+01:00
ITS#10643 lmdb: fix page counts when deleting DUPSORT record
mdb.RE/1.0:
eaa924be by Howard Chu at 2026-10-19T17:41:43+01:00
ITS#10643 lmdb: fix page counts when deleting DUPSORT record
https://bugs.openldap.org/show_bug.cgi?id=10643
--- Comment #5 from Quanah Gibson-Mount quanah@openldap.org --- mdb.master:
74dd6c3e by Howard Chu at 2026-10-20T13:42:39+01:00
ITS#10643 lmdb: more for del DUPSORT
mdb.RE/0.9:
a69ce886 by Howard Chu at 2026-10-20T13:42:47+01:00
ITS#10643 lmdb: more for del DUPSORT
mdb.master3:
ba47717c by Howard Chu at 2026-10-20T13:41:29+01:00
ITS#10643 lmdb: more for del DUPSORT
mdb.RE/1.0:
4865523f by Howard Chu at 2026-10-20T13:42:59+01:00
ITS#10643 lmdb: more for del DUPSORT