@cryptotaxi247 / infra / commits / d05da81e

haumea/zrepl: snapshot more often, rework remote pruning

Snapshots more often should be fine now, as we have a faster connection to receiver, and the churn doesn't seem so significant anymore anyway. With the new remote/receiver, let's do the pruning a bit differently, also exponentially now.

Vladimír Čunát committed Jul 1, 2024 at 09:57 UTC d05da81eee2160a153b05bfd0a4ce5f2bb5f8daa
1 file changed +22 -8
build/haumea/zrepl.nix
+22 -8
@@ -22,7 +22,7 @@
22 filesystems."rpool/safe<" = true;
23 snapshotting = {
24 type = "periodic";
25 - interval = "1h";
25 + interval = "30m";
26 prefix = "zrepl_snap_";
27 hooks = [ {
28 # https://zrepl.github.io/master/configuration/snapshotting.html#postgres-checkpoint-hook
@@ -31,6 +31,8 @@
31 filesystems."rpool/safe/postgres" = true;
32 } ];
33 };
34 +
35 + # The current pruning setup is an exponentially growing scheme, at both sides.
36 pruning = {
37 keep_sender = [
38 { type = "not_replicated"; }
@@ -38,6 +40,7 @@
40 type = "grid";
41 regex = "^zrepl_snap_.*";
42 grid = lib.concatStringsSep " | " [
43 + "1x1h(keep=all)"
44 "1x1h"
45 "1x2h"
46 "1x4h"
@@ -48,7 +51,7 @@
51 "1x2d"
52 "1x4d"
53 "1x8d"
51 - # At this point we keep 9 snapshots spanning 8--16 days (depends on moment),
54 + # At this point we keep ~10 snapshots spanning 8--16 days (depends on moment),
55 # with exponentially increasing spacing (almost).
56 ];
57 }
@@ -57,12 +60,23 @@
60 { type = "grid";
61 regex = "^zrepl_snap_.*";
62 grid = lib.concatStringsSep " | " [
60 - "1x1h"
61 - "1x2h"
62 - "1x4h"
63 - "2x8h"
64 - "7x1d"
65 - "52x1w"
63 + "2x1h(keep=all)"
64 + "2x1h"
65 + "2x2h"
66 + "2x4h"
67 + "4x8h"
68 + # At this point the grid spans 2 days by ~13 snapshots.
69 + # (See note above about 8h -> 24h.)
70 + "2x1d"
71 + "2x2d"
72 + "2x4d"
73 + "2x8d"
74 + "2x16d"
75 + "2x32d"
76 + "2x64d"
77 + "2x128d"
78 + # At this point we keep ~29 snapshots spanning 384--512 days (depends on moment),
79 + # with exponentially increasing spacing (almost).
80 ];
81 }
82 ];