Skip to content

fix: list legacy LMDB cache children#918

Open
nikooo777 wants to merge 1 commit into
edgefrom
fix/bundler-lmdb-list-recovery
Open

fix: list legacy LMDB cache children#918
nikooo777 wants to merge 1 commit into
edgefrom
fix/bundler-lmdb-list-recovery

Conversation

@nikooo777
Copy link
Copy Markdown
Collaborator

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>/bundle

but they do not necessarily write a <<"group">> marker at the parent path. Current hb_cache:list/2 goes through hb_store:read/3, so listing a parent like ~bundler@1.0/tx returns [] 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/3 now delegates to hb_store:list/3 instead of using hb_store:read/3.
  • hb_store_lmdb:list/3 now falls back to listing child keys for a missing parent path, while still rejecting direct listing of simple leaf values.
  • Added a regression test for LMDB children that exist without a group marker.

Why

Bundler recovery depends on prefix listing:

  • dev_bundler_cache:load_bundle_states/1 lists ~bundler@1.0/tx
  • dev_bundler_cache:load_items/2 lists ~bundler@1.0/item

Without this fix, legacy LMDBs with child pseudopaths but no parent group marker look empty to recovery.

Tests

  • rebar3 eunit --module=hb_cache
  • rebar3 eunit --module=hb_store_lmdb

@nikooo777 nikooo777 marked this pull request as ready for review May 19, 2026 19:25
@nikooo777 nikooo777 force-pushed the fix/bundler-lmdb-list-recovery branch 2 times, most recently from 4b4541d to c9e9a0b Compare May 20, 2026 00:48
@nikooo777 nikooo777 force-pushed the fix/bundler-lmdb-list-recovery branch from c9e9a0b to dbebc18 Compare May 22, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant