aboutsummaryrefslogtreecommitdiffstats
path: root/store/test-tree-store.c
Commit message (Collapse)AuthorAgeFilesLines
* Give each store its own writer's turn and commit group (017)eunhhu2026-10-011-2/+39
| | | | | | | | | | | | | | | Threads of one process took turns as the tree store's writer for every store at once, through one mutex held for a whole session, syncs included, and commits grouped in one queue whose leader published each store's requests in turn. One store's slow sync held every other store's commit, so apps of one host would wait on each other's device. The turns and the group are now a store's, found by its directory's identity (two paths to one directory still share them, since the file lock arbitrates only between processes). The temporary files' sequence, which that mutex guarded, is atomic. A test holds a commit in its sync and commits to another store meanwhile, while a second commit to the held store, by another path, waits; before this change it hangs.
* Give a compacted file the zeros of its whole cycle (085)eunhhu2026-09-271-2/+45
| | | | | | | | | | | | | | | | Commits grew the tree store's tail 256 KiB at a time, each growth a sync that also committed the ext4 journal for the new size and blocks. A file installed by compaction now carries written zeros up to where the next compaction will come (4 x live + slack, plus a commit's margin), capped at the size of the file it replaces, so a store never takes more space than before and shrinks when its live data does. The cycle's commits then only overwrite blocks the file has. Store commits: 317.5 -> 385.5 a second, ext4 journal commits 109 -> 45 for 4,000 commits; durable app posts +5.3%, their p99 the same within this SD card's noise. The new cycles test keeps sizes still between compactions once the live data is whole, and shows the file shrinking with it.
* Lay Pure out as a core with the parts selected around iteunhhu2026-09-271-0/+1131
The app model, the tree store and the HTTP host lived in prototypes/connections among the earlier document runtime, the store was known only by its format's name, and Vega compiled six Pure sources by path. Now, as the README's principle has it: core/ runtime, flow and the app model (module*.c), with what the core asks of storage (state.h, store.h) store/ the tree store (PURETRE3, PUREREC1) serve/ pure-serve: HTTP host, outbound delivery, JSON in place cli/ pure-run, pure-edit-module A top-level make builds libpure.a (app model and store, for hosts to link) and the hosts; make check runs the store's and the app model's tests. The earlier runtime still builds from prototypes/connections against core/ and store/ (check, check-tree and check-core pass). Design 009 records the rule: parts by role behind libraries; git repositories split by coupling, so the store stays here while its contract moves with the core, and Vega stays apart.