Running PostgreSQL on Kubernetes · Day 2 Operations with CloudNativePG

Demo 3 — Point-in-Time Recovery

An UPDATE without a WHERE, then a restore to a timestamp before it.

Beats

  1. 0:17Capture a pre-disaster timestamp T0.
  2. 0:24One UPDATE. Correcting a weight.
  3. 0:31Check.
  4. 0:39Oh no!! ... Anyway. Lets recreate.
  5. 0:40Make sure the WAL with our disaster history is flushed to th
  6. 0:53New Cluster CR: bootstrap.recovery from the ObjectStore, tar
  7. 1:0103-pitr-restore.yaml on screen
  8. 1:05Restore reads the base backup, replays WAL up to T0, stops.
  9. 1:16The real weights are back - in the RESTORED cluster. Product
  10. 1:26Recovery is not finished until production is fixed. The tabl
  11. 1:46Production is whole again. THIS is what the restore was for.

Replay it locally

asciinema play -i 2 demos/demo3.cast  ·  download the cast