fresh synthetic marker
fresh full pgBackRest backup
post-backup marker
named restore point
post-target marker
forced WAL switch + pgBackRest check
exact-label restore to a fresh isolated path
read-only and promotion phase measurement
positive/negative business boundary
lineage and timeline proof
isolated shutdown
source postflight
14 adversarial counterexamples
安全边界:
local nonproduction sandbox only
production data/traffic forbidden
source cluster not stopped
live /pg/data not touched
no DCS/Patroni membership for restored copy
no TCP listener
archive push disabled
no routing change
no cleanup during acceptance
production approval pending
Patroni exact member set
pg-test-1 only leader/running
pg-test-2/3 replica/streaming
replay lag <= 1 MiB
source in_recovery=false
archive_mode=on
current WAL segment/timeline
recovery-critical settings
sanitized pgBackRest catalog
source system identifier 只保存在 runner 内存用于 equality,evidence 不导出
raw value。
恢复后重新执行 chapter-19 gate,并在 drill 内检查 .13 live instance:
pg-test-1 leader/running
pg-test-2 replica/streaming
pg-test-3 replica/streaming
all Patroni timeline 7
source system ID unchanged
pg-test-3 in_recovery=true
pg-test-3 replay paused=false
pg-test-3 port=5432
replica lag=0 bytes
isolated timeline 8 不会加入 source Patroni cluster。
不做什么
no pgsql-pitr destructive replacement
no Patroni reinit
no failover/switchover
no /pg/data write
no service routing
no repository expire
no restore directory deletion
fresh full ended before keep
keep WAL and named point were archived
restore stopped at named point
post-target discard did not replay
可以说:
named-point selection for this run passed
不能说:
production RPO = 0
any time in 14 days is recoverable
worst-case archive delay is 0
region loss loses no data
因为实验主动 pg_switch_wal() 并 check,没有模拟 source 在 open segment
尚未归档时突然毁坏。
这次 RTO 测量了什么
已测:
backup command
repository check
file restore copy
start to first read-only
start to promotion
未测:
incident detection
human decision/approval
new host provisioning
cold object retrieval
large production bytes
full business validation
application configuration
DNS/proxy/client cutover
unknown transaction reconciliation
backlog clearing
backup command fails
-> preserve console/log exec-id
-> inspect stanza/repository/archive
-> check source and disk health
-> do not select partial label
-> retry only after cause and policy review
若已插入 base,它只是 synthetic evidence;不要为“干净”自动删。
失败 SOP:archive gap
target segment > repository max or actual restore requests missing WAL
-> stop
-> preserve source pg_wal
-> inspect spool/archive errors/capacity
-> recover missing WAL if possible
-> choose earlier target only with business approval
不能跳过 WAL 或把“最新可到达点”擅自当成批准 target。
失败 SOP:restore/start
restore fails
-> retain exact directory/log
-> ensure no postmaster remains
-> inspect permission/tablespace/key/WAL
-> create a new run/path for retry
不要用 --delta 在不清楚内容的目录上反复覆盖。
失败 SOP:target mismatch
base/keep missing or discard present
-> reject candidate
-> do not expose service
-> review target/backup/inclusive/timeline
-> select a new target with data owner
-> restore to another fresh path
exact target
nonproduction guards
exact run ID
PG36_CH21_RESET_CONFIRM=DELETE_ONE_CH21_SANDBOX_RUN
no postmaster.pid
no Unix socket
path exact allowlist
not symlink
然后只删除一个 retained directory 与对应 run rows。本文 formal 没有执行
reset。
sandbox named PITR
accepted with ten explicit exceptions
PostgreSQL physical lineage
matched
target boundary
base + keep, no discard
isolation
path/process/socket/archive isolated
shared restore host exception remains
source safety
healthy before and after
production
pending
小结
一次可信恢复演练同时具备:
known business boundary
+ fresh or exactly selected backup
+ continuous WAL evidence
+ isolated target
+ two-phase readiness
+ lineage/timeline proof
+ positive and negative invariants
+ source postflight
+ shutdown
+ residual-risk ledger