Skip to content

Immutable edge tables do not emit CDC - #441

Merged
em3s merged 1 commit into
mainfrom
fix/immutable-edge-no-cdc
Jul 21, 2026
Merged

em3s merged 1 commit into
mainfrom
fix/immutable-edge-no-cdc

Conversation

@em3s

@em3s em3s commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Immutable edge tables no longer emit CDC. An immutable edge is an append-only log consumed by scan/poll (it backs queue/v1), not a CDC stream — the log itself is the change history, so streaming a parallel CDC event per append is redundant.

This also removes an asymmetry surfaced while adding scan-and-delete (#438): appends emitted CDC while evictions — which delete storage directly — did not. Now neither does, so an immutable table is consistently CDC-free.

WAL is unaffected: writeWal runs before the CDC step, so durability and async consumption are unchanged. Only the downstream CDC stream is skipped, and only for immutable edges.

Changes

  • MutationService.mutate — skip engine.writeCdc(...) when the table's schema is ModelSchema.ImmutableEdge. Mutable edge / multi-edge / vertex paths are untouched.

How to Test

  • ./gradlew :engine:test --tests "*ImmutableEdgeSpec" — includes a case: append succeeds (CREATED) yet emits no CDC for the table.
  • ./gradlew :engine:test --tests "*GraphSystemAsyncSpec" --tests "*CdcSpec" — non-immutable mutations still emit CDC (regression guard).
  • ./gradlew :engine:spotlessCheck.

AI Assistance

  • This PR was written largely with AI assistance.
    • Tool / model: claude code (opus 4.8)

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Jul 21, 2026
@em3s

em3s commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Optimistic

@em3s
em3s force-pushed the fix/immutable-edge-no-cdc branch from 385bab9 to 49f9579 Compare July 21, 2026 14:30
An immutable edge table is an append-only log consumed by scan/poll, not a CDC
stream — the log itself is the change history, so CDC would be redundant. Skip
`writeCdc` for immutable edges in the mutation path; WAL is unaffected (written
before the CDC step), so durability and async consumption are unchanged.

This also removes an asymmetry surfaced while adding scan-and-delete: appends
emitted CDC while evictions (which delete storage directly) did not. Now neither
does, so an immutable table is consistently CDC-free.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@em3s
em3s force-pushed the fix/immutable-edge-no-cdc branch from 49f9579 to 1aa286c Compare July 21, 2026 14:37
@em3s
em3s merged commit b925512 into main Jul 21, 2026
2 checks passed
@em3s
em3s deleted the fix/immutable-edge-no-cdc branch July 21, 2026 14:46
@em3s em3s self-assigned this Jul 21, 2026
@em3s em3s mentioned this pull request Jul 21, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant