CFE-4701: Preserve LMDB databases across an on-disk format change - #2405
CFE-4701: Preserve LMDB databases across an on-disk format change#2405nickanderson wants to merge 2 commits into
Conversation
49ebec9 to
a6d30c9
Compare
a6d30c9 to
dc40264
Compare
|
Deployment tests pass: pr-pipeline #14421 -> sequential-tests #703 green (150 min), including 13-upgrade-minor (3.27.1 -> 3.29.0a) and 15-upgrade-triple (3.24.4 -> 3.27.1 -> 3.29.0a), both of which cross the LMDB 0.9 -> 1.0 format change. The job does not archive the install logs, so this shows the upgrades succeed, not the dump/reload output itself. |
|
@cf-bottom jenkins please |
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14426/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14426/ |
17b0970 to
539dbb5
Compare
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
539dbb5 to
b50478d
Compare
The MSI runs none of the shell install scripts, so it needs its own migration. InstallFiles overwrites mdb_dump.exe in place, so a custom action copies the old one aside after StopServices and a second one migrates after InstallFiles. Ticket: CFE-4701 Changelog: LMDB databases are now preserved when upgrading the Windows agent across an LMDB on-disk format change
b50478d to
1bab3d3
Compare
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14431/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14431/ |
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14432/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14432/ |
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14433/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14433/ |
|
@craigcomstock this one looks good to go to help clear up CI redness |
Dumps the LMDB databases in the preinstall script using the old
mdb_dumpand reloads them in the postinstall script using the newmdb_load, so upgrading across an LMDB on-disk format change no longer leaves them looking corrupt and gets them deleted. Gated on anLMDB_VERSIONcomparison, so it is a no-op unless the major.minor series actually changes.Windows needs its own path, since the MSI runs none of those scripts:
packaging/cfengine-nova/lmdb-migrate.cmd, driven by custom actions incfengine-nova.wxs.Worth knowing for review: the deployment-test host lists and the
mass.pyplatform matrix contain no Windows entries, so the Windows half is not exercised by CI. It was validated manually with a realmsiexecmajor upgrade on Windows Server 2019.Ticket: CFE-4701
🤖 Generated with Claude Code