Restart Garage automatically, and alert when a Garage node is down #718

Merged
raucao merged 3 commits from chore/garage_systemd into master 2026-12-04 11:30:54 +00:00
Owner

Garage nodes were left dead after a crash because the systemd unit set no restart policy. On 2026-12-04 the garage.service unit on garage-15 (10.1.1.82) was killed by the kernel OOM killer after its block resync loop pushed memory over the 1.9 GB VM's limit; systemd left it down for roughly 1h40m and the cluster saw the node as disconnected the whole time.

This sets Restart=always with a 30s backoff and disables the start rate limit (StartLimitIntervalSec=0) so systemd keeps retrying instead of giving up after a few rapid failures, and adds a critical GarageDown alert so a dead node pages us instead of going unnoticed.

It bumps kosmos_garage and kosmos_prometheus to 0.2.0 and extends the Garage InSpec test to assert the restart policy. The root cause behind the memory pressure — a persistent, cluster-wide block resync error storm from stale block references — is out of scope here and belongs with the Garage upgrade work.

Garage nodes were left dead after a crash because the systemd unit set no restart policy. On 2026-12-04 the garage.service unit on garage-15 (10.1.1.82) was killed by the kernel OOM killer after its block resync loop pushed memory over the 1.9 GB VM's limit; systemd left it down for roughly 1h40m and the cluster saw the node as disconnected the whole time. This sets `Restart=always` with a 30s backoff and disables the start rate limit (`StartLimitIntervalSec=0`) so systemd keeps retrying instead of giving up after a few rapid failures, and adds a critical `GarageDown` alert so a dead node pages us instead of going unnoticed. It bumps kosmos_garage and kosmos_prometheus to 0.2.0 and extends the Garage InSpec test to assert the restart policy. The root cause behind the memory pressure — a persistent, cluster-wide block resync error storm from stale block references — is out of scope here and belongs with the Garage upgrade work.
raucao added 2 commits 2026-12-04 10:18:26 +00:00
The garage.service unit had no restart policy, so a service that died
stayed dead until it was restarted by hand. On 2026-12-04 the unit on
garage-15 (10.1.1.82) was killed by the kernel OOM killer after its block
resync loop pushed memory over the 1.9GB VM's limit; systemd left it down
for ~1h40m and the cluster saw the node as disconnected the whole time.

Set Restart=always with a 30s backoff and disable the start rate limit
(StartLimitIntervalSec=0) so systemd keeps retrying instead of giving up
after a few rapid failures. Bump the cookbook to 0.2.0 and extend the
InSpec test to assert the restart policy.
Prometheus already scrapes Garage (job="garage", port 3903) but there was
no alert on up{job="garage"}, so the 2026-12-04 garage-15 outage went
unnoticed for ~1h40m. Add a critical GarageDown alert and ship it via the
cookbook.
Author
Owner

Rolled out and verified on all 7 Garage nodes on 2026-12-04:

  • Migrated the 6 Chef nodes to Cinc Client (garage-2, 7, 8, 14, 15, 16); garage-11 was already on Cinc.
  • Converged every garage_node; the unit updated without restarting Garage on any node.
  • Effective config on all 7: Restart=always, RestartUSec=30s, StartLimitIntervalUSec=0, OOMPolicy=stop, service active.
  • Proved auto-recovery on garage-15: simulated an unclean kill; systemd logged the failure, scheduled a restart, and Garage came back 30s later (NRestarts=1).

Also converged prometheus-1: /etc/prometheus/rules/garage.yml is loaded (GarageDown) and all 7 up{job="garage"} targets report 1.

Rolled out and verified on all 7 Garage nodes on 2026-12-04: - Migrated the 6 Chef nodes to Cinc Client (garage-2, 7, 8, 14, 15, 16); garage-11 was already on Cinc. - Converged every `garage_node`; the unit updated without restarting Garage on any node. - Effective config on all 7: `Restart=always`, `RestartUSec=30s`, `StartLimitIntervalUSec=0`, `OOMPolicy=stop`, service active. - Proved auto-recovery on garage-15: simulated an unclean kill; systemd logged the failure, scheduled a restart, and Garage came back 30s later (`NRestarts=1`). Also converged prometheus-1: `/etc/prometheus/rules/garage.yml` is loaded (`GarageDown`) and all 7 `up{job="garage"}` targets report 1.
raucao added 1 commit 2026-12-04 10:34:23 +00:00
raucao added the
service
garage
opsenhancement
labels 2026-12-04 10:48:12 +00:00
raucao requested review from greg 2026-12-04 10:48:21 +00:00
greg approved these changes 2026-12-04 10:55:38 +00:00
greg left a comment
Owner

👍

👍
raucao merged commit b431c97129 into master 2026-12-04 11:30:54 +00:00
raucao deleted branch chore/garage_systemd 2026-12-04 11:30:55 +00:00
Author
Owner

Dang, we need something like kredits-github for the Gitea. :/

Dang, we need something like `kredits-github` for the Gitea. :/
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kosmos/chef#718