Commit Graph
27 Commits
Author SHA1 Message Date
jschoubben 8927d68900 Z4 zfs-manifest-bus: the events stream, states and ledger by template, the keeper as the module's one process bus account
The three root processes declare no bus and reach the keeper's socket; the module invokes the service manager's start. The judge refuses the keeper's bus emits and state until the validator accepts what the module asks for in requires (A-38).

Builds: design 42 zfs-owns-zfs §25, §26, §27, §28, A-6, A-19, A-36, A-37, A-38
2026-11-13 01:05:19 +01:00
jschoubben ec27f12524 A-37 the keeper: the module's one process bus account, a socket only root opens, and the root processes' bus through it
Builds: design 42 zfs-owns-zfs §18, §20, §26, §27, A-6, A-20, A-37
2026-11-13 01:04:41 +01:00
jschoubben c6844fc951 Z11 Z12 Z15 the ledger is one instance per dataset and kind, its state a map taken keyed by the ZFS snapshot's name
Builds: design 42 zfs-owns-zfs §21, §22, §26, §28, A-36 (corrects A-30)
2026-11-13 01:03:17 +01:00
jschoubben 9116067e11 Z18 zfs-callsite: the call-site test pins every form of ADR 0679 whole
Renamed TestTheBundleRunsOnlyTheFormsOfADR0679: each root form is held to its whole argument list, no verb the decision never allows, zgenhostid only with the parsed hostid, a device only as cache or log.

Builds: design 42 zfs-owns-zfs §19
2026-11-13 01:01:35 +01:00
jschoubben 5ab8bb7e62 Z1 Z2 Z3 zfs-manifest: packages and values, files and units, the apply and the run in the declared order
The manifest declares zfs-utils and zfs-dkms, renames scrub-pool to pool, and declares every new value not managed until set; its config file is ${config-json}, the options file, ZED's folder, rc, functions, handlers and drop-in each under their condition, the three ZFS units, the apply (run-once, restarted by its config file) and the run before the distribution's scrub and trim timers. One commit: the three subtasks change the one file module.json.

Builds: design 42 zfs-owns-zfs §6, §7, §8, §9, §11, §12, §13, §14, §15, §18, §20, A-1, A-2, A-3, A-7, A-14, A-15, A-16, A-23
2026-11-13 01:00:42 +01:00
jschoubben 97bdb7d656 Z16 zfs-health: a refused or failed command in the applied state is unhealthy naming its key, and the module's own warnings
Builds: design 42 zfs-owns-zfs §29, §15, A-35
2026-11-13 00:55:17 +01:00
jschoubben c0067e77fc Z15 zfs-tools: zfs_config, zfs_snapshots_schedule, zfs_module_events, zfs_snapshots_check and zfs_findings read what the module owns, keeps and says
zfs_config also says what the module says before it leaves a node (Z17): the next load of the kernel module uses ZFS's defaults, the three units and /etc/hostid stay.

Builds: design 42 zfs-owns-zfs §28, §30, §10, A-31, A-35
2026-11-13 00:54:06 +01:00
jschoubben 8aad282e6c Z10 Z12 trim without day or time refused, keep count 0 removes nothing
A trim schedule of weekly or monthly with no trim-day or trim-time is one refused value naming it; a keep count of 0 is that kind's none: the existing scheduled ZFS snapshots are kept and a warning names them.

Builds: design 42 zfs-owns-zfs §20, §21, §22, A-33, A-35
2026-11-13 00:51:11 +01:00
jschoubben dd1a4e083c Z14 zfs-follower: the follower starts the apply on the events that end a wait and keeps its findings in its own state
Builds: design 42 zfs-owns-zfs §18, §27, A-10, A-16, A-32
2026-11-13 00:49:01 +01:00
jschoubben 23256413de Z12 zfs-snapshots-remove: the run removes surplus scheduled ZFS snapshots only by their own record
Builds: design 42 zfs-owns-zfs §22, §26, A-30, A-31
2026-11-13 00:44:07 +01:00
jschoubben a357a85faa Z11 zfs-snapshots-take: the run takes its due ZFS snapshots per filesystem and records each in the ledger
Builds: design 42 zfs-owns-zfs §21, §26, A-19, A-20, A-30, A-31
2026-11-13 00:43:09 +01:00
jschoubben 316039ca95 Z13 zfs-hand-acts: hand acts write their key and start the run; zfs_snapshot keeps a person's snapshots apart
Builds: design 42 zfs-owns-zfs §23, §24, A-12, A-17, A-18
2026-11-13 00:41:21 +01:00
jschoubben 06d83912cd Z10 zfs-run: the scheduled run takes the lock, starts a due scrub and trim without waiting, and acts on hand acts
Builds: design 42 zfs-owns-zfs §20, §24, A-17
2026-11-13 00:38:17 +01:00
jschoubben 1bea6edcb8 Z9 zfs-apply-run: the apply holds the lock, waits on a scrub or an unimported pool, and converges the node's id, ARC and pool
Builds: design 42 zfs-owns-zfs §15, §18, A-8, A-16, A-29
2026-11-13 00:34:58 +01:00
jschoubben 2fb1e5c4ea Z8 zfs-apply-devices: cache and log devices converged by their stable names, after their checks
Builds: design 42 zfs-owns-zfs §17
2026-11-13 00:32:06 +01:00
jschoubben a10bf45ed9 Z7 zfs-apply-properties: pool and dataset properties converged, read back and said
Builds: design 42 zfs-owns-zfs §10, §16
2026-11-13 00:27:31 +01:00
jschoubben 0fa4b5d8e7 Z6 zfs-events-state: each change, refusal and wait said as its event and kept in the state applied
Builds: design 42 zfs-owns-zfs §25, §26, A-19
2026-11-13 00:26:32 +01:00
jschoubben 3cb2b83a15 Z5 zfs-config-parse: the config file's values each read in their fixed form
A value of another form is refused before anything is written or run; absent and empty are not managed.

Builds: design 42 zfs-owns-zfs §9, §11, A-15, A-23
2026-11-13 00:25:48 +01:00
jschoubben bb96fbbb3c zfs: the scheduled run names its minutes, so its timer starts (issue 1979)
mesh/delivery merged: source.main moved to novox/mesh-catalog@117f933dacf0
mesh/check checking bb96fbbb3c45 on 117f933dacf0
The node-engine writes a cron step (*/15) as a calendar systemd refuses, so
zfs-mesh-scrub.timer never started and the pool had no scrub schedule. A list
of minutes is written as *-*-* *:0,15,30,45:00, which systemd takes.

Builds: design 42 zfs-owns-zfs §18. Tests: 1979/AC1.
2026-11-12 23:07:55 +01:00
jschoubben 5ccce4967a Keep three timeout tests' upper bounds well under the production timeouts, so a timeout that falls back to production still fails (issue 1814, review round 3)
mesh/delivery-group group feat/node-packages merged: every member is merged
mesh/delivery merged: source.main moved to novox/mesh-catalog@3483f603ae3d
mesh/check checking 5ccce4967a98 on cff7588797b8 | novox/mesh-catalog#588 in group feat/node-packages
Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
2026-11-01 17:26:58 +01:00
jschoubben b3fcf408f2 Make tests that wait for concurrent work wait on the event or a condition with a long deadline (issue 1814)
A test that slept a fixed time and then asserted what a goroutine, process or
watcher did failed under the checker's load. Each now waits for its positive
evidence (a started baseline, a call counted, a state reached) within 30 s, and
the concurrency-limit tests meet at a barrier instead of overlapping by sleep.

Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
2026-11-01 17:24:19 +01:00
mesh-tools 0260ae92f6 Feature 57 (config and provisioning): release the catalogue, the reviewed release branch merged with main, on top of main 2026-10-16 09:42:45 +00:00
jochen a9acd3dd28 Keep the scheduled run's served slot in a folder of root's alone, written never through a link
mesh/merge-gate pass: builds zfs, sent nowhere; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery delivered
Third review of #147. The run writes as root into /var/lib/zfs-scrub (0700, root's), apart from the
operator account's error counts in /var/lib/zfs-tools, and refuses a folder that is a link, open to
others or someone else's, and a file that is a link: a new file opened O_NOFOLLOW|O_EXCL, renamed over.
2026-10-09 01:55:54 +02:00
jochen bd0182785c Run the scrub schedule as a scheduled process, never pause a scrub, and keep the pool's name the only setting in a unit
mesh/merge-gate pass: builds zfs, sent nowhere; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery superseded: a newer head of the same pull request
The second review of #147 found three blockers before the home server.

1. ${setting:} was not filled in a unit's name, so the distribution timers would have reached the
   machine as "zfs-scrub-weekly@${setting:scrub-pool}.timer". mesh-controller #171 fills it and refuses
   any value that is not a unit-name part. The module's own schedule needs no setting in a name now: the
   node-engine's timer for the scheduled process zfs-mesh-scrub fires `zfs-tools scrub-run` every quarter
   of an hour, and the run reads the pool, cadence, day and time from the configuration file.
2. The run does what upstream's zfs-scrub@.service does: if a scrub is running it waits for it with
   zpool wait -t scrub, otherwise it starts one and waits. It never pauses or stops a scrub, and the unit
   has no ExecStop. A resilver defers the scrub. The served slot is kept in /var/lib/zfs-tools.
3. Unassigning left the pool with no schedule. mesh-host #66 (hq ADR 0269, proposed) gives the
   distribution timer back running and enabled. The README says not to unassign before it is merged.

Also: the run comes before the distribution timers in the declaration; the day and time are checked
against fixed sets and reach no unit file (an invalid value runs nothing); a due scrub not started an
hour after its time is a warning; the error counts outlive a restart in a small state file.
2026-10-09 01:40:02 +02:00
jochen e69506a26f Make the zfs module safe to put on the home server, and give it the pool's scrub schedule
mesh/merge-gate pass: builds zfs, sent nowhere; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery superseded: a newer head of the same pull request
The safety review of the first version found it safe for the pool's data and asked for these fixes before
it goes on the home server:

- zfs_snapshot: no recursive. Every answer gives the dataset's free space and the pool's capacity, and
  says that the snapshot holds every block deleted or overwritten until it is destroyed by hand.
- A command that runs out of time is ended with its whole process group. An act that timed out is
  answered from the list, or as "outcome unknown", never as "NOT DONE".
- The watch runs as the operator account.
- The event follower reads ZFS's queue from its start, with a cursor per boot, so the pool's import and
  any downtime reach the journal once. It writes "dropped N events", kills zpool before waiting for it,
  and exits non-zero after five failed follows in a row.
- Past error counts are a warning, and counts that rise are unhealthy.
- The guard test catches .Run(, exec.Command(, exec.CommandContext( and process starts.
- The fixtures and the parser follow OpenZFS 2.4.4's own printers: human scan sizes under -p, no iostat
  section lines, error scrubs, per-vdev rebuild resilvers, paused scrubs.

The operator also asked the module to own the scrub. A timer and a service of the module's own run
zpool scrub -w -- <pool> from the scrub-pool, scrub-cadence, scrub-day and scrub-time settings. In the
same declaration, the distribution's weekly and monthly timers for that pool are held stopped and
disabled, so exactly one schedule scrubs it. zfs_scrub shows the schedule and the next run, with any
resilver's progress. zfs_scrub_start, zfs_scrub_pause and zfs_scrub_stop act with why. The health check
warns of a late or failed scrub and of a running resilver, and is unhealthy for a resilver that finished
with errors.
2026-10-09 01:17:34 +02:00
jochen c86f055384 Give the test snapshot a creation time apart from the fake clock in every zone
mesh/merge-gate pass: builds new: modules/zfs, sent nowhere; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery delivered
On the build node, in UTC, the fixture's creation time was the fake clock's own instant, so the test
could not tell the list's time from the clock's. A day and a half earlier is apart from it everywhere.
2026-10-09 00:16:29 +02:00
jochen 7c8497225d Add the zfs module, so the mesh can see the home server's pools and snapshot a dataset
mesh/merge-gate pass: builds new: modules/zfs, sent nowhere; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check fail: its merge-check.sh failed: --- FAIL: TestASnapshotIsAnsweredFromTheListAfterwardsAndRecorded (0.00s)
mesh/delivery superseded: a newer head of the same pull request
The home server's pool holds the operator's media library, and no mesh tool could say whether it is
healthy, how full it is, when it was last scrubbed or what snapshots exist; the only way was a login.
This module reads all of it with fixed zfs and zpool commands (list, get, status, iostat, events,
history) and has one act, zfs_snapshot, which only adds a snapshot: refused for an unknown dataset, a
name outside [A-Za-z0-9._-], an existing snapshot or no why; run as sudo -n zfs snapshot -- ds@name;
answered from zfs list afterwards, with any other snapshot that came or went meanwhile; recorded as the
event snapshot.taken. No destroy, rollback, set or send exists, and a test holds every command to its
verb.

Health (ADR 0240): zfs_health on the watch process, unhealthy for a pool not ONLINE, device or data
errors, a pool past 90 % full or no ZFS at all; past 80 % and a scrub older than 35 days are warnings.
Beside it, the event follower (zpool events -f, as root) keeps ZFS's errors in its journal past a
reboot and is judged by its unit, the check the module does not run itself. No seat (ADR 0121), no
package: ZFS is the machine's.
2026-10-09 00:11:31 +02:00