fix: list legacy LMDB cache children#918
Open
nikooo777 wants to merge 1 commit into
Open
Conversation
7 tasks
4b4541d to
c9e9a0b
Compare
c9e9a0b to
dbebc18
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix legacy LMDB child listing so bundler recovery can discover cached recovery state written without explicit group markers.
Older bundler cache entries write leaf pseudopaths directly, for example:
~bundler@1.0/tx/<txid>/status~bundler@1.0/item/<itemid>/bundlebut they do not necessarily write a
<<"group">>marker at the parent path. Currenthb_cache:list/2goes throughhb_store:read/3, so listing a parent like~bundler@1.0/txreturns[]when the parent marker is missing, even though child keys exist underneath it.That causes startup recovery to miss old in-progress bundle states.
What changed
hb_cache:list/3now delegates tohb_store:list/3instead of usinghb_store:read/3.hb_store_lmdb:list/3now falls back to listing child keys for a missing parent path, while still rejecting direct listing of simple leaf values.Why
Bundler recovery depends on prefix listing:
dev_bundler_cache:load_bundle_states/1lists~bundler@1.0/txdev_bundler_cache:load_items/2lists~bundler@1.0/itemWithout this fix, legacy LMDBs with child pseudopaths but no parent group marker look empty to recovery.
Tests
rebar3 eunit --module=hb_cacherebar3 eunit --module=hb_store_lmdb