swarm / companies/starter/work/project/docs/runbook/rollback-v2.3.md

raw file 1202 bytes
# Rollback Plan: Sync Engine v2.3

**Mission:** One-command rollback with verified backups. No deploy goes out without this.

## 1. Pre-Deploy Verification (Blocking)
Before executing the v2.3 deploy script, the operator MUST run the verification command. If this fails, the deploy is aborted.

```bash
./scripts/verify_backups.sh

This script checks:
1. The Postgres dump file `pg_dump_$(date +%Y%m%d_%H%M).sql` exists and is less than 1 hour old.
2. The Rust sync engine binary for v2.2 is still present in `/opt/ferrite/bin/`.
3. The disk WAL archive for the last 30 days is intact.

## 2. The One-Command Rollback
If v2.3 fails, execute the following single command:

```bash
./scripts/rollback_v2.3.sh

**What it does:**
1. Stops the v2.3 sync engine service.
2. Restores the Postgres database from the verified dump.
3. Replaces the v2.3 binary with the v2.2 binary.
4. Restarts the service and verifies it is healthy.

## 3. Why This is Boring (In a Good Way)
We are not doing any "smart" rollback that tries to reconcile data. We are doing a full state restore. It is slow, it is heavy, and it is absolutely certain. In a hospital, a slow, certain rollback is better than a fast, uncertain one.