At 14:00, an inventory service loses its primary database. Its backup dashboard shows a successful copy from midnight. The service has agreed to lose at most five minutes of writes and resume within an hour. To find out whether those targets are achievable, someone needs to restore the data, check where the recovered history ends, and bring the application back through its normal entry point.

Define what the drill has to prove

The recovery point objective (RPO) is the maximum acceptable data loss expressed as time. In this outage scenario, a five-minute RPO means reaching a consistent state at or after 13:55. The recovery time objective (RTO) is the maximum acceptable time to resume the agreed service after the disruption. Start the drill clock at the simulated disruption so detection, escalation, and decision-making are included. Start a second timer for the restore itself to see which steps consume the budget.

Choose another scenario for an accidental update. If a bad change committed at 13:50 and was discovered at 14:00, the appropriate recovery target may precede the bad commit. Record which legitimate later writes would need reconciliation. A single clock difference cannot establish that those writes have been recovered. The AWS Well-Architected recovery guidance likewise calls for querying recovered data and measuring both objectives.

Restore from the same materials available during an incident

PostgreSQL 18 point-in-time recovery uses a physical base backup plus a continuous sequence of write-ahead log (WAL) records. Choose a base backup that finished before the target and confirm that the archive covers the required range from that backup through the target on the intended timeline. Include timeline history files when the recovery path crosses a promotion. Check retention at the oldest point you promise to support, where deleting a single segment can make the remaining files unusable for that target.

Use a new recovery environment with a compatible PostgreSQL installation, tablespace paths, required extensions, and access to the archive and encryption keys. Use the identity an on-call operator or recovery service would have during the incident. Block access to the original primary and keep outbound mail, job consumers, and production integrations disabled. If the original backup came from pg_basebackup with a manifest, pg_verifybackup is a useful integrity check before recovery. The subsequent restore tests whether PostgreSQL and the application can actually use the result.

Check the boundary with committed transactions

In an exercise source, insert numbered markers in separate committed transactions at a known cadence, such as once a minute. Record their commit acknowledgements in an independent log that survives the simulated outage. For a deliberate point-in-time restore, keep the sequence running on both sides of the chosen target. Add a representative business operation, such as a reservation that creates an order and an inventory movement together.

On the isolated PostgreSQL 18 instance, configure restore_command to fetch archived files, use recovery.signal, and set the target with an explicit UTC offset and the intended timeline. With hot standby enabled, recovery_target_action = 'pause' lets you check the result with read-only queries at the target. Confirm from recovery logs that the target was reached and that replay paused as expected. Investigate a missing required WAL segment, even if the server reached an earlier consistent state.

For example, suppose the drill requests 13:58:30 UTC and the external ledger places marker 118 before the target and marker 119 after it, with enough spacing to rule out clock uncertainty. The restored database should contain 118 and lack 119. For the separate loss-of-primary drill, recover from the archive available at the simulated outage and check the newest contiguous marker. A 13:58 marker against a 14:00 outage provides evidence within roughly two minutes at the marker cadence and clock accuracy used. Record that resolution and check for gaps before the newest marker.

Time the service handoff

Check business invariants with read-only queries, such as whether the restored order has its matching inventory movement. Verify the application schema and extension compatibility. For a full rehearsal, finish recovery on the isolated instance after confirming the target. Route a copy of the application to it and run the agreed read and write smoke tests. Include the endpoint switch and connection pool recycling in the clock. A database-only exercise records time to a database milestone. The service result remains unmeasured until application access is verified.

Stage in a sample full drill Elapsed
Detect the outage and assign the operator 4 min
Provision the host and obtain archive access 5 min
Retrieve and unpack the base backup 12 min
Replay WAL to the target 14 min
Validate data and application compatibility 7 min
Switch drill clients and pass smoke tests 6 min
Total 48 min

If WAL replay dominates, compare a newer base backup against the same target and data volume. If key access or provisioning dominates, rehearse that step with the recovery identity. Save the backup ID, target, timeline, verified markers, stage timings, and failed checks in the drill record. Re-run the exercise after changes to backup storage, key access, or data volume. Those records show which recovery objectives the tested setup met and give the next operator a starting point.