fix(engine): stop init cleanup from deleting a completed graph - #502
Merged
aaltshuler merged 4 commits intoAug 16, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
aaltshuler
force-pushed
the
init-cleanup-completed-store
branch
from
August 16, 2026 22:11
89bd7b3 to
79a0d2e
Compare
Collaborator
|
Rebased this PR onto current The updated implementation now:
The new tests cover force/force and force/strict races, table- and manifest-Create lost acknowledgements, exact-genesis mismatch, failed outcome probes, cleanup-delete ambiguity, stale claims, and fresh reopen after recovered acknowledgement. Validation on the final tree:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Closes #495.
Omnigraph::initruns its best-effort schema cleanup on every error, including errors returned afterGraphCoordinator::inithas committed the stamped__manifest, which is the point where the graph is durably complete. Past that point the cleanup deletes the three schema files while the Lance data stays, leaving a graph that neither opens (raw storage read error) nor re-inits (Dataset already exists); the only recovery is deleting the root by hand. A process crash at the same point leaves an openable graph, so the damage is entirely cleanup-induced: backward recovery applied past the commit point.initat the commit point: the commit phase now ends at the__manifestcommit, so an error from it is provably pre-commit and keeps today's cleanup; the post-commit checks run as a separate step whose errors return with the graph untouched and a message stating the graph is intact and opens normally.__manifestand data are present but_schema.pgis missing,openreturns a typed not-found naming the state and the remedy (restore the schema files, or rebuild via export) instead of a raw storage read error.Future work
A forward-recovery path that completes a post-commit failure instead of reporting it was considered and deferred; it needs the recovery-sidecar protocol extended to init and is worth its own RFC.
Local verification
cargo test -p omnigraph-engine --features failpoints --test failpoints: green; the flipped pinning testinit_failpoint_after_coordinator_init_leaves_completed_store_intactfailed pre-fix with the predicted signature (schema files deleted, raw storage read error on reopen), and the newopen_missing_schema_pg_reports_schema_files_missingcovers the floor.cargo test --workspace --locked --features omnigraph-engine/failpoints,omnigraph-cluster/failpoints: green, plusscripts/check-agents-md.shafter the docs edit.cargo clippy --workspace --all-targets --locked -- -D warnings -W clippy::dbg_macroon both CI feature graphs andcargo fmt --all --check: clean.Greptile Summary
The PR separates initialization at the durable manifest commit boundary and adds exact-attempt recovery for acknowledgement-unknown creates.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Acquire durable init claim] --> B[Write schema contract] B --> C[Create physical tables and manifest] C -->|Confirmed manifest commit| D[Run post-commit checks] C -->|Outcome unknown| E[Probe exact genesis receipt] E -->|Exact receipt found| F[Finish coordinator validation] E -->|Probe fails or mismatches| G[Return InitializationIndeterminate and retain claim] D -->|Success| H[Release claim and return graph] D -->|Failure| I[Release claim and return InitializationCommitted] F -->|Success| H F -->|Failure| I B -->|Failure before physical init| J[Clean owned schema artifacts and release claim]Reviews (4): Last reviewed commit: "fix(engine): make graph initialization o..." | Re-trigger Greptile
Context used (3)