mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-15 01:55:13 +02:00
docs: pre-stage write precondition tolerates benign drift, defers sidecar-covered
- writes.md: new subsection specifying the tolerant precondition (OCC fence = fresh manifest pin; benign drift proceeds, sidecar-covered defers, stale handle still 409s), the load-bearing content-preserving invariant, and the Hyrum's-law observable change (409 -> success on benign drift). - invariants.md: Truth Matrix row for the precondition + deny-list entry forbidding non-content-preserving uncovered HEAD advances without a sidecar. - testing.md: list the five new tolerance tests under the writes.rs / schema_apply.rs rows. - maintenance.md + AGENTS.md: correct the now-stale claim that optimize's publish is required for strict writes / schema apply to pass their precondition — they tolerate benign drift; the publish is for reader visibility and bounded drift.
This commit is contained in:
parent
954b5453d1
commit
595c6516f2
5 changed files with 67 additions and 4 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
## `optimize_all_tables(db)` — non-destructive
|
||||
|
||||
- Lance `compact_files()` on every node + edge table on `main`, then **publishes the compacted version to the `__manifest`** so the manifest's `table_version` tracks the compacted Lance HEAD. Reads pin the manifest version, so without this publish compaction would be invisible to readers *and* would break the HEAD-vs-manifest precondition of the next schema apply / strict update/delete ("stale view … refresh and retry"). The publish advances the graph version (a system-attributed commit) only for tables that actually compacted.
|
||||
- Lance `compact_files()` on every node + edge table on `main`, then **publishes the compacted version to the `__manifest`** so the manifest's `table_version` tracks the compacted Lance HEAD. Reads pin the manifest version, so without this publish compaction would be invisible to readers until the next write. The publish advances the graph version (a system-attributed commit) only for tables that actually compacted. (Even if a graph is left with uncompacted `HEAD > manifest` drift — e.g. an old-binary optimize that never published, or an external `compact_files` — strict writes and schema apply now tolerate that benign drift and reconcile it on the next write; see the pre-stage write precondition in [docs/dev/writes.md](../dev/writes.md). The publish is still done so reads observe compaction immediately and system-produced drift stays bounded.)
|
||||
- Rewrites small fragments into fewer large ones; old fragments remain reachable via older manifests until `cleanup` runs.
|
||||
- Each table's compact→publish runs under its per-`(table, main)` write queue (serializing with concurrent mutations — compaction is a Lance `Rewrite` op that retryable-conflicts with a concurrent merge/update/delete on overlapping fragments). The Lance-HEAD-before-manifest-publish gap is covered by a `SidecarKind::Optimize` recovery sidecar (loose-match): a crash in that window rolls the compacted version forward on the next `Omnigraph::open` (compaction is content-preserving, so roll-forward is always safe).
|
||||
- **Requires a recovered graph.** `optimize` refuses (errors) when an unresolved recovery sidecar is present under `__recovery` — operating on an unrecovered graph could publish a partial write the open-time recovery sweep would roll back. Reopen the graph to run the recovery sweep, then re-run `optimize`. (Recovery roll-back now publishes its restored version, so a recovered graph always satisfies `manifest == Lance HEAD` going in; there is no leftover drift for `optimize` to interpret.)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue