diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-20 22:46:31 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-20 22:46:31 +0300 |
| commit | 233c6676017c8f1ac8e4987c93e206bdc14b7c6b (patch) | |
| tree | 3257c4593c21d5d329b8558826c71802853545d4 /prompts/skills/f3s-storage/references/zrepl.md | |
| parent | f363ad70db0f4d4df27a7b8c9e96e21ef7aa45d4 (diff) | |
f3s-storage skill: document zrepl replication liveness check (f0 cron canary)
f0 root crontab touches /data/nfs/nfs.LIVE_CHECK every 10 min, gated on
/data/nfs/nfs.DO_NOT_REMOVE. zrepl replicates zdata/enc/nfsdata to f1's
read-only sink every minute, so the file's mtime on f1 reveals replication
freshness (stalled if >~10-11 min behind). Added to zrepl.md and the hub
SKILL.md reference bullet.
Diffstat (limited to 'prompts/skills/f3s-storage/references/zrepl.md')
| -rw-r--r-- | prompts/skills/f3s-storage/references/zrepl.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/prompts/skills/f3s-storage/references/zrepl.md b/prompts/skills/f3s-storage/references/zrepl.md index dc90676..ea31644 100644 --- a/prompts/skills/f3s-storage/references/zrepl.md +++ b/prompts/skills/f3s-storage/references/zrepl.md @@ -198,6 +198,35 @@ doas zfs mount zdata/sink/f0/zdata/enc/nfsdata doas zfs set readonly=on zdata/sink/f0/zdata/enc/nfsdata # prevent replication breakage ``` +## Replication liveness check + +A small cron job on f0 writes a canary file into the replicated dataset so its +presence and mtime on f1's read-only sink reveals how fresh the zrepl +replication is. + +On **f0** (root crontab), every 10 minutes, gated on a sentinel file so the +canary only runs when the dataset is actually in use: + +``` +*/10 * * * * test -f /data/nfs/nfs.DO_NOT_REMOVE && /usr/bin/touch /data/nfs/nfs.LIVE_CHECK +``` + +`/data/nfs` on f0 is `zdata/enc/nfsdata` — the dataset the `f0_to_f1_nfsdata` +job pushes to f1 every minute. zrepl snapshots + sends, so the touched +`nfs.LIVE_CHECK` (and its mtime) appear on f1's read-only sink at +`/data/nfs/nfs.LIVE_CHECK` within roughly one replication interval. + +On **f1**, read the replica to check freshness (the sink is read-only): + +```sh +stat -f '%Sm' /data/nfs/nfs.LIVE_CHECK # f0's last touch time, as replicated +date '+%Sm' # compare to now +``` + +If the mtime lags more than ~10–11 minutes behind real time, zrepl replication +is stalled (see Troubleshooting). The `/data/nfs/nfs.DO_NOT_REMOVE` sentinel +also doubles as the zrepl-replication canary guard. Installed on f0 2026-07-20. + ## Failover design: intentionally read-only replica The standby replica is read-only by design. Manual failover (not automatic) to prevent split-brain. To fix broken replication after accidental writes: `doas zfs rollback <snapshot>`. |
