NixOS / infra

NixOS configurations for nixos.org and its servers
MIT License
208 stars 91 forks source link

haumea/zrepl: create pg checkpoint before taking snapshot #444

Closed mweinelt closed 1 week ago

mweinelt commented 2 weeks ago

Creating a checkpoint flushes all memory to disk, and applies all WAL files to persistent storage, forward-paying the cost of WAL replay, but on the other hand making snapshots much cheaper.

https://zrepl.github.io/master/configuration/snapshotting.html#job-hook-type-postgres-checkpoint https://www.postgresql.org/docs/current/sql-checkpoint.html https://www.postgresql.org/docs/current/wal-configuration.html

Whether we should do this is debatable, but the linked documentation should be studied in full, before we make a decision.