Around Go: DevOps and reliability · 3 MIN READ
Respond to an incident without destroying the accepted writes
Use a bounded runbook to gather evidence, choose a reversible mitigation and distinguish binary rollback from restoring persistent data.
An incident begins with user impact and uncertainty. A useful responder establishes scope, a current owner and an evidence timeline before trying unrelated commands. Recovery must preserve work the service already acknowledged, including writes accepted after a backup or a server move.
Go for DevOps and reliability · A MAP OF THE IDEA
- Establish impact and owner
- Collect bounded evidence
- Choose a recoverable mitigation
- Verify and improve the runbook
Useful when
- Use a bounded runbook to gather evidence, choose a reversible mitigation and distinguish binary rollback from restoring persistent data.
- Make changes reviewable and verify the result against the original contract.
Watch out
- Rehearse restoration in isolation and preserve/reconcile later accepted writes. Binary compatibility, persistent-data recovery and route verification are separate obligations.
Implementation & operation cost: Automation needs explicit ownership, bounded privileges, tests and recovery evidence; a shorter command is not sufficient.
Start with read-only evidence and an explicit target
Confirm the environment, service, affected operation and time window. Inspect the actual serving image, route, process health, recent release and user-outcome telemetry. For Kubernetes, verify context/namespace before logs or rollout inspection; for a Linux service, verify the named unit and journal window. Record facts separately from hypotheses. Keep access credentials and customer payloads out of shared incident notes.
Select a mitigation with an owner and stop condition
A mitigation may reduce traffic, disable a failing optional feature or restore a compatible binary. Name the person controlling the change, the exact target and version, the expected result, a deadline and the point at which to stop or reverse. Preserve original evidence while limiting ongoing impact. Communicate the observed effect rather than declaring recovery because a command exited zero. Concurrent responders should avoid silently changing the same resource.
A recovery decision model
The program returns a reviewable recommendation and performs no rollback or restore. An old binary is a candidate only when its declared reader range includes the current schema. If a restore would erase later acknowledged writes, recovering into a separate environment and reconciling those writes must be considered. The model intentionally has no “overwrite live data now” action.
package main
import "fmt"
type Incident struct { CurrentSchema, OldReaderMin, OldReaderMax int; WritesSinceBackup bool }
func recoveryPlan(i Incident) string {
if i.CurrentSchema < 1 || i.OldReaderMin < 1 || i.OldReaderMin > i.OldReaderMax { return "reject invalid compatibility evidence" }
if i.CurrentSchema >= i.OldReaderMin && i.CurrentSchema <= i.OldReaderMax { return "candidate: roll back binary; verify route and outcomes" }
if i.WritesSinceBackup { return "roll forward or restore separately and reconcile accepted writes" }
return "rehearse isolated restore; do not overwrite the live writer"
}
func main() {
fmt.Println(recoveryPlan(Incident{CurrentSchema: 2, OldReaderMin: 1, OldReaderMax: 2}))
fmt.Println(recoveryPlan(Incident{CurrentSchema: 2, OldReaderMin: 1, OldReaderMax: 1, WritesSinceBackup: true}))
fmt.Println(recoveryPlan(Incident{CurrentSchema: 2, OldReaderMin: 1, OldReaderMax: 1}))
}
Expected lines: candidate: roll back binary; verify route and outcomes; roll forward or restore separately and reconcile accepted writes; rehearse isolated restore; do not overwrite the live writer. Compatibility metadata itself needs tests against real schemas, not optimistic labels.
Rehearse backup restoration before an emergency
A completed backup job does not prove a usable restore. In an isolated environment, restore a known snapshot, verify integrity and application reads, document required configuration/key references and measure recovery time. State the accepted data-loss window and the source of truth for later writes. A container image rollback does not restore a database, and copying files while a writer is active is not automatically a consistent backup. Use the storage engine’s documented recovery method.
Close the loop with a blameless improvement
Verify the user operation through the real route and observe the recovery window. Record the impact, detection gap, sequence of actions, contributing conditions and evidence for recovery. Add an independently testable action with an owner and due criterion: a missing compatibility test, a clearer runbook or a safer rollout gate. Keep the record focused on system behavior and learning. The goal is to reduce the chance and cost of repetition, not to identify a person to blame.
TAKE THIS WITH YOU
Use a bounded runbook to gather evidence, choose a reversible mitigation and distinguish binary rollback from restoring persistent data.
Check your understanding
An old backup predates accepted writes. What makes a restore plan reviewable?
Go to the source
Progress stays in this browser. No account needed.