Features
Index unreferenced sectors for pruning
Sectors now track how many contract and temp storage references they have, and
a location holds a lock while a sector is being written to it. The prune sweep
reads unreferenced sectors from an index instead of scanning every stored
sector, which on a 100 TiB host held the database for about six seconds every
five minutes. The last access timestamp is removed. The upgrade computes the
counts for existing sectors and rewrites the sector table, which takes about a
minute at that size.
Fixes
- Allow concurrent database reads
- Fix high CPU usage during sector pruning
- Sector migration no longer holds the database lock while copying data
- Removed the in-memory sector cache, the sectorCacheSize setting is now ignored
- Reverted back to encoding/json from sonic.
- Update go.sia.tech/coreutils to v0.24.1
Fix the merkle cache bloating the stored sectors table
The cache kept 32 KiB of subtree roots inline on every sector row, which slowed
sector reads, pruning and contract root lookups. Cached roots are discarded on
upgrade and rebuilt on the next read.