mcl-graph: CozoDB on SQLite only — no RocksDB, no import, no way back #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "pallas/19-off-rocksdb"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (work): mcl-graph leaves RocksDB for good — the store is CozoDB on its SQLite engine in
graph.sqliteand nothing else — so the RocksDB images can be deleted once every service is ported (macula-io/macula-ci-images#19 step 1b, design §2 as amended on 2026-11-23).DECIDED 2026-11-23 (Raf): "we don't use rocksDB anymore", then "Port them off, then delete (Recommended)", and "Yes, build it (Recommended)" for this package; then "Drop the migration (Recommended)", after his question "is there even a 'before the switch'? AFAIK, mcl-graph has never really been used". The design's mcl-graph section is amended on macula-io/macula-ci-images#19 (comment 1003) and in
DESIGN_2026-11-23_off-rocksdb.md, with the Supervisor's evidence:/bulk0/mcl-graph/dataholds one 2109-byte sst of the two relation definitions (10 entries, 2026-10-06) and empty WALs since. There is no graph data.What changes — the removal, from the ported tip
5113d67mcl_graph_migrate(R3, the one-time import) withmcl_graph_migrate_tests, andmcl_graph_reverse_export(R4, the way back) withmcl_graph_reverse_export_tests, andmcl_graph_store_migration_tests. There is nothing to import and nothing to go back to. A boot on a data directory with nograph.sqlitegets a fresh store and its schema, whatever else sits beside it; the old RocksDB directory is never opened.Cargo.tomlasks cozo forstorage-sqlite, so cozorocks — and with it RocksDB, lz4 and zstd — leaves cozo's dependency graph.Cargo.lockis regenerated: 212 lines out, and the three remaining insertions are the dependency lists re-sorted.mcl_graph_nif:open/1replacesopen/2;backup/2,restore/2andsync_path/1go with the import that used them, andopen/1is the whole surface. The stub, the Rust crate, the moduledoc and the NIF's own comments say one engine, one file, created on the first open.mcl_graph_store:initensures the data directory and opensgraph.sqlitein it; CozoDB creates the file.schema_statements/0is removed — only the deleted tests used it.open/1) and image paragraphs say no RocksDB is linked, and the stale RocksDB comments inmcl_graph.app.src,config/sys.config.src,Containerfile,native/build-nif.sh,scripts/ci-gate.sh,lint-and-test.ymlandbuild-push.ymlare corrected.macula-ci-otpbuilds andmacula-pq-runtimeruns, each by digest, lint's job container is the builder with the org's read-only pull account (CI_IMAGE_PULL_USER/CI_IMAGE_PULL_TOKEN), the checkout is plain shell, and the NIF cache stays GitHub-only.ci-images-*.ymlfiles stay byte-for-byte pinned copies and are not edited here.The C4 diagrams are unchanged, and that is checked, not assumed.
c4_diagrams.pynever named RocksDB, and a regeneration with/usr/bin/python3 -Iin this tree reproducesassets/c4-context.svg,c4-containers.svgandc4-components.svgbyte for byte, so the c4-model compare job sees no drift.Tests: 131 eunit tests, all passing — the previous 150 less the 19 that the three deleted test files carried. The store's own suite still runs against the real NIF on a real
graph.sqlite, including the restart that has to find the schema already there; nothing in the remaining suite is mocked where it used to open a database.Proof on this tip (
3fef4ea8f14d12ff29e07cfa5d975a4ba4818e5e): on msi00,scripts/ci-gate.shwith_buildcleared (rm -rf, because podman 6.2 silently dropsFRESH=1's tmpfs under a bind mount — mcl-graph#1), exit code 0:rebar3 lintclean,rebar3 eunit131 tests passed,rebar3 dialyzerclean over 14 files (two modules fewer than before). The cold NIF build took 2m46s, in place of the many minutes the cozorocks compile cost. On the forge, on this exact sha: 2254c4-modelsuccess (its jobsc4-modelandc4-model-1, so the pinned copy's SVG compare ran) and 2255lint-and-testsuccess (jobcheck), both on3fef4ea.Review: the removal only,
5113d67..3fef4ea, by Jupiter, at most one round. Nothing is deployed by this change: the fleet image pin and the deletion of/bulk0/mcl-graph/dataare Raf's menu, not this PR.Refs macula-io/macula-ci-images#19
A marker says an import finished here; with graph.sqlite gone, re-importing the kept RocksDB store would serve the cutover-era graph and drop every write since, and with no store either the service would start empty. Both now stop with {marker_without_graph, Marker}. Two tests plant each case.mcl-graph: the store opens SQLite, with a one-time import off RocksDB and a way backto mcl-graph: CozoDB on SQLite only — no RocksDB, no import, no way back