fix: the VIP overlay waits for etcd's cluster, as etcd does (keel#106) #189

Merged
navigator merged 3 commits from fix/vip-overlay-waits-for-etcd-106 into main 2026-10-16 10:54:42 -03:00
Owner

Fixes #106. Stacked on #187 (common#56), which is stacked on #185: merge those first.

keel-vip.service has ConditionPathExists=/var/lib/keel/etcd/cluster.json, so it never runs in cloud simple, and in cloud advanced it waits until etcd forms. Before, keel diff reported overlays.vip: drift (declared enabled, observed keel-vip.service enabled and inactive) on every cloud simple pair, and each apply printed "start keel-vip.service: done" for a start that did nothing.

What changes, mirroring what etcd's overlay does while it waits for its cluster:

  • keel diff: before cluster.json exists, overlays.vip compares only whether the unit is enabled, and gives the reason (without etcd, keel vip check and its timer do the VIP's work). A unit that is not enabled is still drift.
  • keel spec apply: before cluster.json exists, the unit is enabled and not started, and the step says why. With the cluster, both compare and converge the unit as before.

Tests: tests/test_vip_overlay_waits.py (diff and apply, before and after the cluster). The cross-site test of 19.0-3 runs in cloud advanced, so CI is the proof of the cloud simple case.

keel 0.23.35.

Fixes #106. Stacked on #187 (common#56), which is stacked on #185: merge those first. `keel-vip.service` has `ConditionPathExists=/var/lib/keel/etcd/cluster.json`, so it never runs in cloud simple, and in cloud advanced it waits until etcd forms. Before, `keel diff` reported `overlays.vip: drift (declared enabled, observed keel-vip.service enabled and inactive)` on every cloud simple pair, and each apply printed "start keel-vip.service: done" for a start that did nothing. What changes, mirroring what etcd's overlay does while it waits for its cluster: - `keel diff`: before `cluster.json` exists, `overlays.vip` compares only whether the unit is enabled, and gives the reason (without etcd, `keel vip check` and its timer do the VIP's work). A unit that is not enabled is still drift. - `keel spec apply`: before `cluster.json` exists, the unit is enabled and not started, and the step says why. With the cluster, both compare and converge the unit as before. Tests: `tests/test_vip_overlay_waits.py` (diff and apply, before and after the cluster). The cross-site test of 19.0-3 runs in cloud advanced, so CI is the proof of the cloud simple case. keel 0.23.35.
The reseed probe sums pg_database_size() over every database as the
role repl. That function needs CONNECT on the database. The keel-lnpp
check database revoked CONNECT from PUBLIC, and every reseed of the
LNPP pair refused: "permission denied for database keel_check".

The netns test of the pair now revokes CONNECT on the shop database
from PUBLIC before case (d), as the check database did. The unit tests
ask that the probe measures only the databases repl may connect to,
and that a refusal for lack of space names the databases it left out.
pg_database_size() needs CONNECT on the database or the role
pg_read_all_stats. An application database with REVOKE CONNECT FROM
PUBLIC stopped every reseed with "permission denied".

The probe now sums the size with a FILTER on
has_database_privilege(oid, 'CONNECT') and counts the databases it
leaves out. The free space check uses the size it has. When the check
refuses, the message says how many databases the need leaves out. The
base backup itself is not changed: it copies the whole cluster.

pg_read_all_stats is not granted to repl: it gives more read access
than the reseed needs.
chore: keel 0.23.33 (keel#183)
All checks were successful
security / security (pull_request) Successful in 1m35s
tests / etcd (pull_request) Successful in 6m27s
tests / vip (pull_request) Successful in 7m14s
tests / mesh (pull_request) Successful in 11m7s
tests / etcd-auth (pull_request) Successful in 5m7s
tests / package (pull_request) Successful in 8s
tests / vip-upgrade (pull_request) Successful in 7m41s
tests / mariadb-simple (pull_request) Successful in 5m16s
tests / mariadb (pull_request) Successful in 7m12s
tests / tests (pull_request) Successful in 18m41s
tests / postgres (pull_request) Successful in 11m17s
a6271bbc9b
On a pair, keel-overlay-anubis-key.service makes no key on the database
replica: the key is shared and comes from the primary (decision 0041).
Nothing copied it, so anubis@keel did not start there, and the apply
failed the anubis overlay. The LNMP and LNPP pair tests copied the key
by hand (Keel-Linux/common#56).

The tests ask that the other member of the pair record, and no other
member, gets the key over the members' channel; that a paired replica
with no key asks for it in a run that may change the machine, and
writes it with mode 0600 before Anubis starts; that a replica in no
pair yet starts nothing and says why; and that an unreachable primary
refuses the step.
The secret message of the members' channel gives a second name,
anubis/signing_key, answered with /etc/anubis/keel.key only to the
other member of the pair record, as the replication credential is.

keel.system.anubiskey observes, on the live system and only in a run
that may change the machine, a node whose spec makes it a database
replica, with Anubis enabled, no key file and no
secrets.anubis_signing_key declared. It asks the other member of its
pair, and the plan writes the key (mode 0600) before the overlay's
units start. The key unit then finds the key and leaves it.

Before the pair record exists, the apply starts nothing for Anubis and
says why, so the first boot of a replica no longer fails the overlay. A
key that is there is never replaced.
chore: keel 0.23.34 (common#56)
Some checks are pending
security / security (pull_request) Waiting to run
tests / tests (pull_request) Waiting to run
tests / mesh (pull_request) Waiting to run
tests / etcd (pull_request) Waiting to run
tests / vip (pull_request) Waiting to run
tests / vip-upgrade (pull_request) Waiting to run
tests / etcd-auth (pull_request) Waiting to run
tests / mariadb (pull_request) Waiting to run
tests / mariadb-simple (pull_request) Waiting to run
tests / postgres (pull_request) Waiting to run
tests / package (pull_request) Waiting to run
240512d44c
keel-vip.service starts only when /var/lib/keel/etcd/cluster.json
exists. On a cloud simple pair, keel diff reported overlays.vip as
drift (enabled and inactive) on every run, and each apply printed a
start of the unit that did nothing.

The tests ask that, before the cluster exists, diff compares only
whether the unit is enabled and says why it does not run, and that
apply enables the unit and does not start it. With the cluster, an
inactive controller is drift and apply starts it, as before.
Before etcd's cluster.json exists (always in cloud simple, and in
cloud advanced until etcd forms), the start condition of
keel-vip.service holds it. keel diff now compares only whether the
unit is enabled, and gives the reason: without etcd, keel vip check
(keel-vip-check.timer) does the VIP's work. keel spec apply enables the
unit, does not start it, and says why. With the cluster, both compare
and converge the unit as before.
chore: keel 0.23.35 (keel#106)
Some checks are pending
security / security (pull_request) Waiting to run
tests / tests (pull_request) Waiting to run
tests / mesh (pull_request) Waiting to run
tests / etcd (pull_request) Waiting to run
tests / vip (pull_request) Waiting to run
tests / vip-upgrade (pull_request) Waiting to run
tests / etcd-auth (pull_request) Waiting to run
tests / mariadb (pull_request) Waiting to run
tests / mariadb-simple (pull_request) Waiting to run
tests / postgres (pull_request) Waiting to run
tests / package (pull_request) Waiting to run
b1f0252597
navigator force-pushed fix/vip-overlay-waits-for-etcd-106 from b1f0252597
Some checks are pending
security / security (pull_request) Waiting to run
tests / tests (pull_request) Waiting to run
tests / mesh (pull_request) Waiting to run
tests / etcd (pull_request) Waiting to run
tests / vip (pull_request) Waiting to run
tests / vip-upgrade (pull_request) Waiting to run
tests / etcd-auth (pull_request) Waiting to run
tests / mariadb (pull_request) Waiting to run
tests / mariadb-simple (pull_request) Waiting to run
tests / postgres (pull_request) Waiting to run
tests / package (pull_request) Waiting to run
to 093da566b6
Some checks are pending
security / security (pull_request) Waiting to run
tests / tests (pull_request) Waiting to run
tests / mesh (pull_request) Waiting to run
tests / etcd (pull_request) Waiting to run
tests / postgres (pull_request) Waiting to run
tests / package (pull_request) Waiting to run
tests / vip (pull_request) Waiting to run
tests / vip-upgrade (pull_request) Waiting to run
tests / etcd-auth (pull_request) Waiting to run
tests / mariadb (pull_request) Waiting to run
tests / mariadb-simple (pull_request) Waiting to run
2026-10-16 07:16:21 -03:00
Compare
navigator force-pushed fix/vip-overlay-waits-for-etcd-106 from 093da566b6
Some checks are pending
security / security (pull_request) Waiting to run
tests / tests (pull_request) Waiting to run
tests / mesh (pull_request) Waiting to run
tests / etcd (pull_request) Waiting to run
tests / postgres (pull_request) Waiting to run
tests / package (pull_request) Waiting to run
tests / vip (pull_request) Waiting to run
tests / vip-upgrade (pull_request) Waiting to run
tests / etcd-auth (pull_request) Waiting to run
tests / mariadb (pull_request) Waiting to run
tests / mariadb-simple (pull_request) Waiting to run
to a4790d991a
All checks were successful
security / security (pull_request) Successful in 1m49s
tests / etcd (pull_request) Successful in 7m6s
tests / vip (pull_request) Successful in 7m26s
tests / vip-upgrade (pull_request) Successful in 8m15s
tests / mesh (pull_request) Successful in 11m38s
tests / package (pull_request) Successful in 8s
tests / mariadb-simple (pull_request) Successful in 4m55s
tests / etcd-auth (pull_request) Successful in 5m59s
tests / mariadb (pull_request) Successful in 6m15s
tests / tests (pull_request) Successful in 20m33s
tests / postgres (pull_request) Successful in 11m1s
2026-10-16 07:54:59 -03:00
Compare
navigator force-pushed fix/vip-overlay-waits-for-etcd-106 from a4790d991a
All checks were successful
security / security (pull_request) Successful in 1m49s
tests / etcd (pull_request) Successful in 7m6s
tests / vip (pull_request) Successful in 7m26s
tests / vip-upgrade (pull_request) Successful in 8m15s
tests / mesh (pull_request) Successful in 11m38s
tests / package (pull_request) Successful in 8s
tests / mariadb-simple (pull_request) Successful in 4m55s
tests / etcd-auth (pull_request) Successful in 5m59s
tests / mariadb (pull_request) Successful in 6m15s
tests / tests (pull_request) Successful in 20m33s
tests / postgres (pull_request) Successful in 11m1s
to 7df4bc9649
All checks were successful
security / security (pull_request) Successful in 1m27s
tests / etcd (pull_request) Successful in 6m51s
tests / vip (pull_request) Successful in 6m38s
tests / mesh (pull_request) Successful in 11m20s
tests / etcd-auth (pull_request) Successful in 5m34s
tests / package (pull_request) Successful in 10s
tests / vip-upgrade (pull_request) Successful in 7m38s
tests / mariadb (pull_request) Successful in 6m19s
tests / mariadb-simple (pull_request) Successful in 5m25s
tests / tests (pull_request) Successful in 20m32s
tests / postgres (pull_request) Successful in 10m58s
2026-10-16 10:04:19 -03:00
Compare
Sign in to join this conversation.
No description provided.