Skip to content

Implement RFC-026 Phase A MemWAL foundation#368

Merged
aaltshuler merged 2 commits into
mainfrom
codex/rfc026-phase-a
Jul 18, 2026
Merged

Implement RFC-026 Phase A MemWAL foundation#368
aaltshuler merged 2 commits into
mainfrom
codex/rfc026-phase-a

Conversation

@aaltshuler

@aaltshuler aaltshuler commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • activate internal manifest schema v7 with identity-keyed MemWAL lifecycle authority
  • add a private, main-only Phase-A enrollment adapter for one exact empty unsharded shard
  • add recovery-v10 exact N / N+1 classification and roll-forward-or-retire behavior
  • put root-shared stream-admission leases outside the existing schema → branch → table gates
  • fence ordinary writers, schema changes, maintenance, repair adoption, and recovery against lifecycle-bound tables
  • preserve the narrow native-branch exception at SEALED and reject OPEN / DRAINING topology changes
  • refuse partial MemWAL format states and enforce the v6 → v7 export/import boundary
  • update RFC-026, write-path, versioning, testing, upgrade, and state-of-affairs documentation

Why

RFC-022 made the direct-publish path correct, but streaming cannot safely begin with row admission. We first need durable lifecycle ownership, exact crash classification, and one admission/exclusion order shared by every physical writer. This slice establishes that correctness and format foundation using Lance MemWAL rather than introducing a custom WAL or transaction manager.

Deliberate boundary

This does not expose public stream enrollment, @stream, WAL row put, durable row acknowledgement, fold, drain/resume, or fresh-read behavior. The supported Phase-A topology is canonical main, one empty unsharded shard, and one live writer process.

Validation

  • cargo test --workspace --locked
  • cargo test -p omnigraph-engine --features failpoints --test failpoints --locked — 140 passed, 1 intentional helper ignored
  • MemWAL enrollment gate — 15 passed
  • genuine v6 ↔ v7 cross-version refusal/rebuild test
  • scripts/check-agents-md.sh
  • git diff --check
  • independent red-team source review with no remaining blocker

Greptile Summary

This PR adds the RFC-026 Phase A MemWAL foundation. The main changes are:

  • Activates manifest schema v7 with identity-keyed stream lifecycle state.
  • Adds private enrollment for one empty, unsharded main-table WAL.
  • Adds exact recovery and roll-forward behavior for enrollment.
  • Fences conflicting writes, schema changes, maintenance, repair, and recovery.
  • Enforces v6-to-v7 export and import migration boundaries.
  • Updates tests and documentation for the new storage contract.

Confidence Score: 5/5

This looks safe to merge.

  • Post-publication sidecar deletion failure no longer turns a completed enrollment into a caller-visible failure.
  • Failures before durable publication or audit still propagate.
  • A retained sidecar is recovered idempotently without republishing enrollment state.
  • No blocking issue remains within the reviewed follow-up scope.

Important Files Changed

Filename Overview
crates/omnigraph/src/db/manifest/recovery.rs Adds stream-enrollment recovery and separates required recovery cleanup from best-effort cleanup after durable publication.
crates/omnigraph/src/db/omnigraph/stream_enrollment.rs Adds the private Phase A enrollment flow and verifies the published OPEN lifecycle.
crates/omnigraph/src/table_store/mem_wal.rs Adds the bounded MemWAL storage adapter used by Phase A enrollment and recovery.
crates/omnigraph/tests/failpoints.rs Adds failure-path tests for enrollment publication, cleanup, and later recovery.

Reviews (2): Last reviewed commit: "fix: preserve stream enrollment success ..." | Re-trigger Greptile

Context used:

  • Context used - AGENTS.md (source)
  • Context used - CLAUDE.md (source)

Comment thread crates/omnigraph/src/db/manifest/recovery.rs Outdated
@aaltshuler
aaltshuler merged commit 158e698 into main Jul 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant