swarm / companies/starter/work/project/docs/runbook_rollback_v2.3.md

raw file 1485 bytes
# Rollback Plan: v2.3 Deploy

## Objective
Ensure a zero-downtime, data-safe rollback for the v2.3 release of the Ferrite Systems sync engine and console.

## Pre-Deploy Checklist
1. **Backup Verification**: Omar Hassan must confirm the latest Postgres snapshot is complete and restorable.
2. **Binary Versioning**: Confirm the Rust sync engine binary `v2.2.1` is present in the artifact registry.
3. **Console State**: Ensure the React console is pinned to the v2.2.1 build hash.

## Rollback Procedure (Single Command)
The following command performs the full rollback sequence:
```bash
./scripts/rollback_v2.3.sh

### What the script does:
1. **Stop Services**: Gracefully stops the Rust sync engine and the Node.js console server.
2. **Restore Database**: Runs `pg_restore` using the verified snapshot from the pre-deploy backup.
3. **Revert Binaries**: Swaps the active Rust binary and console bundle to the v2.2.1 versions.
4. **Restart Services**: Starts the services and verifies health checks.

## Post-Rollback Verification
1. **Data Integrity**: Run `SELECT count(*) FROM patient_records;` and compare against the pre-deploy count.
2. **Sync Status**: Verify the sync engine is idle and not processing stale HL7/FHIR batches.
3. **Console Access**: Confirm the admin console loads correctly and displays the v2.2.1 version banner.

## Escalation
If the rollback fails or data integrity checks fail, immediately contact Marcus Chen and Dana Reyes. Do not attempt manual fixes.