Skip to content

fix(storage): replay valid exploratory edge fragments without losing route semantics #1218

Description

@DecisionNerd

A verified #1213 baseline cannot replay a node-property delta against valid resumable-construction output. Construction publishes each logical exploratory relationship group separately within a bounded ID window, mapping those groups to one physical _exploratory route. Each fragment is internally sorted, but their ID ranges overlap. Replay concatenates the fragments and rejects the next fragment's lower first ID with canonical edge_id order is not strictly increasing.

Evidence from the public fixture (1,025 nodes / 4,097 edges / two logical relationships, current main plus the isolated #1216 replacement repair): the first two construction fragments in one exploratory route contain 522 rows with IDs 1..1018 and 502 rows with IDs 2..1024; neither has an internal inversion. Ordinary node-property mutation preserves those fragments. publish_graph_delta(SetNodeProperty) then fails at writer.rs:758. Construction emits EXPLORATORY_EDGE_SCHEMA with per-row rel_type_name; replay currently opens TYPED_EDGE_SCHEMA, so relationship schema preservation also needs direct proof. This is current-format production behavior, not a compatibility case.

Bounded blocker for #1213's already-required construction/replay/compaction semantics and #1194. No duplicate found in searches for edge_id/replay and exploratory/replay.

Acceptance criteria:

  • Public construction with multiple exploratory relationship types (the regression fixture previously emitted overlapping fragment ranges) produces a replay-valid current layout and supports delta replay and compaction, subsequent mutation, reopen, exact query, export, verify and clean import.
  • Preserve full-width node/edge IDs, UUIDs, endpoint identities, per-row relationship types, labels, nullable/tagged properties and semantic-route ownership. Cover typed and exploratory routes and retained-parent construction where applicable.
  • Maintain corruption detection: reject duplicate or invalid IDs and inconsistent replacement IDs; do not merely remove the global-order assertion. Produce a layout valid for subsequent replay.
  • Prefer coalescing logical groups into one sorted physical-route fragment within each existing bounded construction window; preserve per-row relationship names and replay overlay routing. No compatibility reader for prior defective output is required. Keep input reader count, row groups, buffering and any temporary merge work explicitly bounded. Measure read/write work and peak resource reservations; no unbounded full-graph sort or materialization.
  • Preserve authentication, crash recovery, cancellation and active query snapshots. Do not introduce compatibility readers/migration machinery or change encoding policy in this repair.
  • Focused PR with direct regression evidence, required exact-head CI Gate, independent review and squash merge.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions