Part of #4325.
Context
The review engine's primary datastore is Postgres with the pgvector extension (--profile postgres in docker-compose.yml). This needs to move to the new host with full data integrity and minimal write-downtime, while the current host stays authoritative until cutover.
Requirements
- A migration approach that supports at least one full sync followed by incremental catch-up (e.g.
pg_dump/pg_restore for the initial copy, then either logical replication or a final short-downtime pg_dump delta at actual cutover time) — a single one-shot dump taken hours before cutover is not sufficient given the current host keeps taking live writes throughout this epic.
- Explicit row-count and checksum verification of at least the highest-value tables post-restore (e.g.
pull_requests, ai_review_cache, audit_events, repositories) — silent partial restores are the failure mode to design against.
pgvector extension version parity confirmed on the new host before restore (an extension-version mismatch is a plausible restore-time failure, not a hypothetical).
- A written rollback: if the restored data fails verification, cutover does not proceed and the current host remains authoritative.
Deliverables
Expected outcome
A validated, repeatable procedure to bring the new host's Postgres to full parity with the current host's live data, on demand, right up to the actual cutover moment.
Effort
L
Part of #4325.
Context
The review engine's primary datastore is Postgres with the
pgvectorextension (--profile postgresindocker-compose.yml). This needs to move to the new host with full data integrity and minimal write-downtime, while the current host stays authoritative until cutover.Requirements
pg_dump/pg_restorefor the initial copy, then either logical replication or a final short-downtimepg_dumpdelta at actual cutover time) — a single one-shot dump taken hours before cutover is not sufficient given the current host keeps taking live writes throughout this epic.pull_requests,ai_review_cache,audit_events,repositories) — silent partial restores are the failure mode to design against.pgvectorextension version parity confirmed on the new host before restore (an extension-version mismatch is a plausible restore-time failure, not a hypothetical).Deliverables
pgvectorversion confirmed matching before any real restore is attemptedExpected outcome
A validated, repeatable procedure to bring the new host's Postgres to full parity with the current host's live data, on demand, right up to the actual cutover moment.
Effort
L