hiero-ledger / hiero-ledger/hiero-consensus-node
Cleanup index files when restoring from a snapshot
- 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
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