Skip to content

feat(relay): provision the Vitess database ahead of the Postgres cutover - #5305

Open
juliusmarminge wants to merge 1 commit into
mainfrom
relay/provision-vitess-db
Open

feat(relay): provision the Vitess database ahead of the Postgres cutover#5305
juliusmarminge wants to merge 1 commit into
mainfrom
relay/provision-vitess-db

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 3, 2026

Copy link
Copy Markdown
Member

Phase 1 of the relay Postgres → Vitess migration (see the stacked cutover PR for the full picture and runbook).

Adds RelayMysqlDatabase (t3coderelay-vitess, us-west, PS_20) to the prod stack with the checked-in migrations/mysql baseline. Deploying this creates the empty Vitess database and applies the schema via the alchemy migration runner — relay_migrations bookkeeping included — while the worker keeps running on Postgres. That lets AWS DMS replicate production data into the target before the cutover PR flips Hyperdrive.

No worker or runtime changes; Postgres remains the live database.

🤖 Generated with Claude Code


Note

Medium Risk
Prod infra now provisions an additional live database and applies schema on deploy; misconfiguration could affect migration bookkeeping or DMS target readiness, but runtime traffic stays on Postgres until cutover.

Overview
Phase 1 of the relay Postgres → Vitess migration: prod deploys now also provision PlanetScale MySQL (t3coderelay-vitess, us-west, PS_20) when relayDatabaseMode is shared-database, alongside the existing Postgres database.

A new checked-in MySQL baseline in migrations/mysql creates all relay_* tables and indexes (mirroring Postgres) and is applied via relay_migrations on deploy. The worker and Hyperdrive still use Postgres; nothing reads or writes MySQL until the cutover PR.

Adds the Drizzle snapshot for the MySQL baseline migration metadata.

Reviewed by Cursor Bugbot for commit 394dead. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Provision Vitess MySQL database ahead of Postgres cutover for relay service

  • Adds a Planetscale MySQL database resource (t3coderelay-vitess, us-west, PS_20, 2 replicas) in db.ts when relayDatabaseMode returns "shared-database".
  • Adds a baseline MySQL migration in migration.sql that creates all relay_* tables, indexes, and schema matching the existing Postgres structure.
  • The Postgres database continues to be provisioned and used; the MySQL resource is additive at this stage.
  • Behavioral Change: shared-database deployments now provision an additional database resource with RemovalPolicy.retain().

Macroscope summarized 394dead.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 72fe4696-16dd-43c4-8320-2dd10cec5f72

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Aug 3, 2026
@github-actions github-actions Bot added the size:XXL 1,000+ changed lines (additions + deletions). label Aug 3, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR provisions new production MySQL/Vitess database infrastructure ahead of a Postgres-to-Vitess migration. Production infrastructure changes of this significance warrant human review, even when the code diff is small.

You can customize Macroscope's approvability policy. Learn more.

Phase 1 of the relay Postgres -> Vitess migration: create the
t3coderelay-vitess MySQL database in the prod stack and apply the
checked-in baseline schema via the alchemy migration runner, while the
worker keeps running on Postgres. This lets DMS replicate production
data into the target before the cutover PR flips Hyperdrive.

See docs/operations/relay-postgres-to-vitess-migration.md (cutover PR)
for the full runbook.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the relay/provision-vitess-db branch from 779a484 to 394dead Compare August 3, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant