Alexey
October 27, 2026, 2:22am
27
Memtbl stores changes in another log file, so when you restart, it’s loaded and continues to work. If this file is corrupted, it should trigger a fsck on restart to rebuild missing memtbl.
Hashstore actually supports two forms of hash table data structures - the “fast one”, called “memtbl”, where the hash table is stored in memory and changes to it are written to another log file, or the “still-fast-but-uses-much-less-RAM” one, called “hashtbl”, where the hashtable itself is mapped to disk via mmap.
The “memtbl” approach takes an additional step of eliminating this last random write, at the cost of explicitly storing an even smaller amount of metadata entirely in RAM. The “memtbl” doesn’t even store the full piece id to reduce RAM-based hash table entry size further. This approach requires an additional on-disk data structure that is an append-only event log, but all writes to it are sequential. This approach is better if you have more RAM, and does not need an SSD for the best performance.
Your system will use a swap file/drive.