summaryrefslogtreecommitdiff
path: root/test/behaviour/tree.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 15:20:35 -0300
committerGabriel Schneider <[email protected]>2026-11-05 19:16:37 -0300
commit1eae252b80ddab0a06574de700b6b2957d3b64fc (patch)
treec37ca247d17ade01d55129a448d38f7cc5b99aaa /test/behaviour/tree.zig
parent15a1b94eaa73747afaa299262a2d6e4fd6af42fd (diff)
downloadpardes-1eae252b80ddab0a06574de700b6b2957d3b64fc.tar.gz
pardes-1eae252b80ddab0a06574de700b6b2957d3b64fc.zip
blob cache: a far client's blobs are kept in `cache.xitdb` (src/Db.zig's Cache, in $XDG_CACHE_HOME/pardes, else ~/.cache/pardes), a file of its own and never the state file (expendable, and up to a gigabyte): `blobs/<hash>` the texts, `seqs/<hash>` and `seen` (a sorted map, a number to its hash, the least recently used first) their order, `size` and `next`; a join's blobs are put in one transaction by the client's storing thread, with those it found there made the most recently used (a hit takes a new number), and at the client's end what it made since is put and the cache trimmed: past the cap (PARDES_BLOB_CACHE_MB, 1 GiB) the oldest go in one transaction and the file is compacted into `cache.xitdb.new` and renamed over it, where a directory of files was scanned, sorted and deleted from at each join; each use opens the file for itself (a database a thread, as xitdb asks), a text read back is hashed again (one kept wrong is a miss, and goes), and a file that is no database is started afresh; replica.zig's Cache (its directory, the hex names, put by rename, trim by scan) goes for Db.Cache; tests: replica.zig's 'a cached blob is hashed again as it is read: one cut short, corrupted, planted or longer is a miss, and goes' and 'the blob cache stays under its cap, the least recently used going first' are rewritten for the file (texts kept wrong under a hash through put, the order made by hits, and the file seen compacted), 'a blob cache that is no database is started afresh' is new, the far join test keeps its biggest blob wrong through the cache rather than a file, and daemon.py's far clients read the cache file's size, cut it short by hand where they corrupted files, and check the cap after a client's end where they planted junk files
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/behaviour/tree.zig')
0 files changed, 0 insertions, 0 deletions