Skip to content

Fix DBPrivClean() for LMDB 1.0.0 mdb_drop() semantics#6235

Merged
craigcomstock merged 1 commit into
cfengine:masterfrom
aleksandrychev:lmbd_fix
Jul 17, 2026
Merged

Fix DBPrivClean() for LMDB 1.0.0 mdb_drop() semantics#6235
craigcomstock merged 1 commit into
cfengine:masterfrom
aleksandrychev:lmbd_fix

Conversation

@aleksandrychev

Copy link
Copy Markdown
Contributor

LMDB 1.0.0 changed mdb_drop(): emptying the main DBI marks the transaction MDB_TXN_DROPPED, so any subsequent read/write on that same transaction fails with MDB_BAD_TXN. CFEngine reuses one write transaction per thread and callers typically repopulate the DB right after cleaning it, which triggered the failure.

LMDB 1.0.0 changed mdb_drop(): emptying the main DBI marks the
transaction MDB_TXN_DROPPED, so any subsequent read/write on that
same transaction fails with MDB_BAD_TXN. CFEngine reuses one write
transaction per thread and callers typically repopulate the DB right
after cleaning it, which triggered the failure.

Signed-off-by: Ihor Aleksandrychiev <ihor.aleksandrychiev@northern.tech>
@cf-bottom

Copy link
Copy Markdown

Thanks for submitting a PR! Maybe @craigcomstock can review this?

@aleksandrychev
aleksandrychev marked this pull request as ready for review July 17, 2026 14:20
@craigcomstock
craigcomstock merged commit e8a605d into cfengine:master Jul 17, 2026
46 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants