DDL and TRUNCATE leave shapes silently stale (schema read once at boot)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with setup_postgres and replication.rs:231-276 and 447-449, then trace how registered schemas and shapes are represented. Compare the existing invalidation and refetch behavior described in the issue with the DDL, TRUNCATE, and replica-identity paths. Done means affected shapes are invalidated and refetched rather than silently serving stale or incomplete data.
Written by the indexing model from the issue text.
Description
Found during the production-readiness investigation.
Symptoms / failure scenarios:
- Schema is introspected once in
setup_postgresand never refreshed. AfterALTER TABLE ... ADD COLUMN,parse_colssilently drops the new column from every envelope (apps/engine/src/replication.rs:447-449) — synced rows are missing the column until an engine restart, with no error. TRUNCATEproduces no envelopes — it only logs (replication.rs:269-276). Truncated rows linger forever in every shape, aggregate, and subquery inner set.- A
REPLICA IDENTITYregression (e.g. a migration recreated the table) degrades to forwarding new-only updates and skipping deletes (replication.rs:231-265) — shapes keep phantom rows.
In all three cases we keep serving wrong data quietly. Upstream invalidates affected shapes (409 → client refetch) and runs a 60s SchemaReconciler sweep to catch silent DDL.
Fix direction: periodic re-introspection diffed against the registered schema; on change, TRUNCATE, or replica-identity regression → invalidate affected shapes (drop + refetch signal), never degrade silently. (Moving to pgoutput later provides relation messages for free.)
🤖 Generated with Claude Code
- Dominant language
- Rust
- Stars
- 31
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from electric-sql/electric-circuits
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in electric-sql/electric-circuits
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
trezor/trezor-firmware#7997 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
smol-machines/smolvm#1489 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day