code wiki / (root) / nx_seg_compact_cli.nx

nx_seg_compact_cli.nx

buildroot/runtime/nx_seg_compact_cli.nx

3821 B65 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic seg
docsdependenciesstructsconstsfunctions

about

nx_seg_compact_cli.nx -- run seg-store COMPACTION for one shard prefix. Folds all live segments into ONE merged segment (latest entry per key; tombstones kept), archives the retired segment names (additive -- never deletes), atomically swaps the live manifest. This is the PERF fix for the data-driven-search debt: after fixing the 256-segment read cap, search loads ALL live segments per query -- compaction folds a large uncompacted shard (e.g. 936 segs) into ~1 so per-query load stays cheap. Uses the FIXED (data-driven, no 256/260 cap) ss_compact. Runs in nishihost CWD (the dp-<domain>-pub- store resolves there). usage: nx_seg_compact_cli <store-prefix> <new-segid> e.g. nx_seg_compact_cli knowledge/store/dp-nishifamily.com-pub- 9000000000000000001 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_seg_store.nx nx_seg_compact_cli.nx

imports: nx_syscalls.nxnx_seg_store.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main scc_puts sys_write scc_atoi sys_mmap ss_cat sys_openat_append sys_flock ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻ ss_cat ↻ ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_munmap scc_putn sys_mmap ↻ sys_write ↻ ss_compact sys_mmap ↻ ss_manifest_dyn ↻ ss_cat ↻ ss_readall ↻ ss_r32 ss_kcmp ss_begin_cap sys_mmap ↻ ss_add2 ss_w32 ss_write_seg ss_segid_ok sys_mmap ↻ ss_cat ↻ ss_catn sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

13func scc_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
14func scc_putn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
23func scc_atoi(s: *u8) -> i64
called by 1: main
29func main(argc: i64, argv: *i64) -> i64