Skip to content

Latest commit

 

History

History
94 lines (76 loc) · 5.61 KB

File metadata and controls

94 lines (76 loc) · 5.61 KB
title pg hardstorage recovery drill
description CLI reference for the pg hardstorage recovery drill command.
tags
cli
reference

pg_hardstorage recovery drill

Run a full restore-and-verify drill against a real backup

Synopsis

Pick a backup, restore into a temporary target dir, run pg_verifybackup against the restored data dir, and tear down. Reports RTO actual + verify outcome.

The drill exercises the full critical path that a real recovery would take. Read-only against the source repo; writes only to a temporary target dir which is removed on completion (unless --keep is set).

Backup selection: | latest pick the freshest committed backup pick the named manifest (must be visible)

Verify control: --pg-major NN override the sandbox image (default: derive from manifest) --image IMG override 'postgres:' (air-gapped registries) --allow-skip-verify accept a Partial verdict when pg_verifybackup skips (e.g. older manifest with no on-disk backup_manifest) --skip-verify strongest opt-out — don't even try to spin up the sandbox. Returns Partial verdict with the restore-only result.

Output formats: --format json (default) — JSON body, the v1 contract. --format markdown — forensics-grade GFM rendering.

The drill requires Docker on the operator host (for the sandbox). For Docker-free runs, pass --skip-verify; the report's RTO actual

  • restore-phase detail are still useful for capacity planning.
pg_hardstorage recovery drill <deployment> [flags]

Options

      --allow-skip-verify   accept a Partial verdict when pg_verifybackup skips
      --backup-id string    explicit backup ID to drill against (default: latest)
      --format string       output format: json | markdown (default "json")
  -h, --help                help for drill
      --image string        override 'postgres:<major>' sandbox image (air-gapped)
      --keep                keep the temporary target dir after the drill (for inspection)
      --no-encryption       don't wire the local-keystore KEK resolver (drill an unencrypted backup or one whose KEK lives elsewhere)
      --no-history          suppress the auto-persist of a slim drill history entry into recovery/drills/
      --operator string     record the operator identity in the history entry (free-form; cron jobs typically pass scheduler:<task-id>)
      --pg-major string     override sandbox PG major version (default: derive from manifest)
      --repo string         repository URL (required)
      --rto-seconds int     RTO target in seconds for actual-vs-target comparison
      --skip-verify         don't run the sandbox verify at all (Docker-free run)
      --temp-base string    parent directory for the temporary target dir (default: $TMPDIR)

Options inherited from parent commands

      --airgapped airgapped: strict                                                       refuse outbound endpoints (LLM providers, sinks, OTLP collectors) outside loopback / RFC1918 / explicit airgap.allowlist. Also enabled by PG_HARDSTORAGE_AIRGAPPED=1 or airgapped: strict in the config file.
  -c, --config string                                                                     path to config file (default: XDG/FHS lookup)
      --cpu-profile go tool pprof <path>                                                  write a pprof CPU profile to this path for the duration of the command (go tool pprof <path> to analyse). Off when empty.
      --mem-profile string                                                                write a pprof heap profile to this path at command exit. Off when empty.
      --no-color                                                                          disable ANSI color in text output
      --on-error-llm                                                                      on a structured-error failure, drop into the matching LLM helper skill (auto_on_error trigger). Also enabled by PG_HARDSTORAGE_ON_ERROR_LLM=1.
      --otel-endpoint string                                                              OpenTelemetry OTLP/HTTP endpoint (e.g. http://otel-collector:4318); empty disables tracing
      --otel-stdout                                                                       also export OpenTelemetry traces to stderr (useful for dev)
  -o, --output string                                                                     output format: text|json|ndjson|yaml|template|csv|markdown|html|tap|junit|pdf (default: text on TTY, json off-TTY)
      --profile-port go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30   if non-zero, expose net/http/pprof on 127.0.0.1:<port> for live profiling of long-running commands (e.g. go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30). Off when zero.
  -q, --quiet                                                                             suppress non-essential output
      --template string                                                                   Go text/template applied when --output template (or implied if --template is set without --output)

SEE ALSO