pacman keeps one mirror list for the mesh, ranked in the write that opens each round and written by every node (ADR 0585, issue 1876)

Each node's reflector ranked its own list on its own timer, and on 2026-10-31 one node's
lagging first mirror left it a Node.js version behind the rest. The list is now the
module's state mirrors, key list: the node that opens a week's round ranks it with the
module's reflector options, keeps only mirrors whose last sync is no older than the
newest found, and the round's key names the list's revision. Every keeper writes
/etc/pacman.d/mirrorlist whole from the key through the root helper's new verb
mirrorlist, when the key changes and when the file differs, and never writes an empty
or unreadable list. reflector.timer is declared stopped and disabled, and reflector.conf
saves nothing. pacman_mirrors answers the shared list, its ranker and age and whether
this node's file matches; with refresh it asks this node's keeper to rank again,
refused while a round runs, naming it. The round's integration test proves the opening
write and both nodes' files.

Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
This commit is contained in:
2026-11-01 16:18:22 +01:00
parent 37613ec6a9
commit 2b495c4818
19 changed files with 770 additions and 111 deletions
+16 -9
View File
@@ -17,10 +17,15 @@ that seat (ADR 0207).
- The manifest test runs `pacman-conf` on the rendered file and checks the repository list and the
options as pacman reads them. It skips that check where `pacman-conf` is absent.
- The host keeps the machine's previous file once, the first time it writes over it (ADR 0102).
- **Mirrors.** The `reflector` package, `/etc/xdg/reflector/reflector.conf` written whole (https,
Belgium, the Netherlands, Luxembourg, Germany, France, the 20 most recently synced, sorted by
rate, saved to `/etc/pacman.d/mirrorlist`), and `reflector.timer` running and enabled. The mirror
list stays reflector's to write, not the mesh's.
- **One mirror list for the mesh (ADR 0585).** The `reflector` package as the ranking tool,
`/etc/xdg/reflector/reflector.conf` written whole with its options (https, Belgium, the Netherlands,
Luxembourg, Germany, France, the 20 most recently synced, sorted by rate; nothing saved), and
`reflector.timer` declared stopped and disabled. The list is the module's state `mirrors`, one key
`list`: the node that opens a week's round ranks it with those options inside the write that opens
the round, keeps only the mirrors whose last sync is no older than the newest found, and the
round's key names the list's revision. Every node's keeper writes `/etc/pacman.d/mirrorlist` whole
from it through the root helper when the key changes and when the file differs, so a hand edit
comes back; an empty or unreadable list is never written.
- **Cache cleaning.** The `pacman-contrib` package and `paccache.timer` running and enabled. Each
week it keeps the last three versions of each package.
- **The package view on the bus (ADR 0507).** A process of its own, the keeper (`pacman-tools keeper`, account
@@ -65,15 +70,17 @@ that seat (ADR 0207).
## What it improves
- Mirrors were generated once and never again: in 2022, 2023 and 2024, and on one machine by its
hosting provider's installer. The list is now refreshed weekly. The timer's first run is at the
next weekly boundary; `pacman_mirrors` with `refresh: true` runs it at once.
hosting provider's installer. Then each node's reflector ranked its own list weekly, and on
2026-10-31 one node's lagging first mirror left it a version behind the rest. Now every node of a
round upgrades from one list ranked when the round opened; `pacman_mirrors` with `refresh: true`
ranks it again for the mesh, refused while a round runs.
- Package caches were never cleaned. One workstation held 48 GB, of which paccache would free 33 GB.
- Every machine has the same options. Only one had parallel downloads.
## What it leaves found
- `/etc/pacman.d/mirrorlist`, which reflector rewrites, and the stale `mirrorlist.pacnew`,
`.bak`, `.original` and similar copies beside it.
- The stale `mirrorlist.pacnew`, `.bak`, `.original` and similar copies beside the mirror list.
Until the first round opens (or a refresh), each node keeps the mirror list it has.
- `/etc/pacman.d/hooks`, the keyring, and the AUR helper. Packages from outside the repositories
are research 027 question 1.
@@ -97,7 +104,7 @@ that seat (ADR 0207).
| `pacman_remove_orphans` | a | `pacman -Rs` on named orphans, or all of them, as a unit of its own; a name that is not an orphan is refused |
| `pacman_cache` | r/a | size, interrupted downloads, what paccache would free keeping N; `clean: true` removes them |
| `pacman_history` | r | `/var/log/pacman.log`: installs, upgrades, downgrades, reinstalls and removals since a day, and the last full upgrade |
| `pacman_mirrors` | r/a | the list, its generator and age, reflector's options, timer and last run; `refresh: true` starts reflector |
| `pacman_mirrors` | r/a | the mesh's list, who ranked it and its age, and whether this node's file matches; `refresh: true` ranks it again for the mesh, refused during a round |
| `pacman_foreign` | r | the foreign packages, from `installed` on the bus |
| `pacman_news` | r | the distribution's news since the last full upgrade (or a day), over https; no network is `reachable: false` |
| `pacman_config` | r | `pacman-conf`: options, repositories, and whether `/etc/pacman.conf` is the module's |