haumea/zrepl: create pg checkpoint before taking snapshot
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
Martin Weinelt committed
Jun 16, 2024 at 00:45 UTC
dec25013c8f9fb7659d5cb1e28457955ca2b1634
1 file changed
+6
delft/haumea/zrepl.nix
+6
@@ -24,6 +24,12 @@
24
type = "periodic";
25
interval = "5m";
26
prefix = "zrepl_snap_";
27
+ hooks = [ {
28
+ # https://zrepl.github.io/master/configuration/snapshotting.html#postgres-checkpoint-hook
29
+ type = "postgres-checkpoint";
30
+ dsn = "host=/run/postgresql user=root sslmode=disable";
31
+ filesystems."rpool/safe/postgres" = true;
32
+ } ];
33
};
34
pruning = {
35
keep_sender = [