Skip to content

Preserve LMDB databases across an on-disk format change - #2405

Open
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:CFE-4701/master
Open

Preserve LMDB databases across an on-disk format change#2405
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:CFE-4701/master

Conversation

@nickanderson

@nickanderson nickanderson commented Aug 6, 2026

Copy link
Copy Markdown
Member

Dumps the LMDB databases in the preinstall script using the old mdb_dump and reloads them in the postinstall script using the new mdb_load, so upgrading across an LMDB on-disk format change no longer leaves them looking corrupt and gets them deleted. Gated on a LMDB_VERSION comparison, so it is a no-op unless the major.minor series actually changes.

Ticket: CFE-4701

🤖 Generated with Claude Code

LMDB 1.0 cannot read databases written by 0.9, and reports them as
MDB_INVALID, which CFEngine treats as corruption and deletes. Export the
databases in the preinstall script while the old mdb_dump is still
installed, and import them again in the postinstall script.

Ticket: CFE-4701
Changelog: LMDB databases in the state directory are now preserved when upgrading across an LMDB on-disk format change, instead of being discarded as corrupt
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.

1 participant