hiero-ledger / hiero-ledger/hiero-consensus-node

Cleanup index files when restoring from a snapshot

Open
#6,169 0 comments 0 reactions 0 assignees View on GitHub
Good First Issue Candidate P3 Platform Platform Data Structures Platform Virtual Map Tech Debt Reduced
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

When a virtual map is included to a snapshot, it dumps all indices (path to hash, path to leaf, key to path) to snapshot directory as `*.ll` files. On node restart, the indices are loaded back to memory as `LongListOffHeap` or `LongListDisk` instances, but the files are kept on disk for no good reason. Note that the files aren't loaded directly from snapshot dirs. Instead, snapshots are first restored (by creating hard links) to a temp folder, and then data sources are instantiated from this folder. It means, the files can be deleted without affecting snapshot contents.

Contributor guide

Open the contributing guide

Research direction

Start by tracing snapshot restoration from the temporary folder through creation of the LongListOffHeap and LongListDisk instances. Confirm that the *.ll files are no longer needed after data sources are instantiated, then verify that cleanup removes only restored temporary files and leaves snapshot contents intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
database
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.