FFORGE//RS
← Roadmap

distributed systems / LEVEL 5

The migration that raced the old binary

EST.55 MIN
01

THEORY / RETRIEVAL

What to restore

  • Apply expand-contract instead of coupling deploy and destructive DDL
  • Backfill and validate before enforcing a new invariant
  • Keep old and new Rust binaries compatible during a rolling deployment

Deployments create a mixed-version interval

During rollout, old readers, new readers, old writers and new writers may run simultaneously. Expand-contract first adds backward-compatible schema, then deploys compatible code, dual-writes or backfills, switches reads, and removes obsolete state only after old binaries are gone.

Validation and enforcement are separate operations

Large-table rewrites and strong locks belong in an explicit migration plan. A common PostgreSQL pattern adds a constraint without validating existing rows, backfills in bounded batches, validates, then enforces the invariant. Exact lock behavior must be checked for the deployed PostgreSQL version and DDL form.

CHECKPOINT

When is it safe to drop the old column in an expand-contract migration?

ISOLATED RUST 1.96
src/lib.rsEDIT

02 / CODE REVIEW

Make the code safe

Validate the required rollout plan for this service. Return Duplicate for any repeated phase, UnsafeOrder when a phase skips its prerequisite, and Incomplete unless all nine phases finish. Do not silently sort the operator's plan.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
1 / 64 KB
OUTPUT
Runner is waiting for a submission.