Files
autocraft/deploy/compose
aiongg 8a688a2260 Leader election for the runner and the periodic chores on Postgres
Two copies of the runner or of the periodic chores can run on one Postgres database: the copy that holds the
role's session-level advisory lock leads, the other waits as a standby and takes over when the leader's
session ends. A new leader moves the role's epoch and fences its writes, and those of its jobs, to it: every
write transaction checks the epoch after the writer lock, so writes of a leader that lost its lock fail. The
old leader kills its jobs and exits when its lock connection fails or a check of the lock fails. A standby
runner answers /readyz with 503; /healthz/checks gains runner-leader and periodic-leader. The periodic loop
moves to deploy/periodic.sh, run by autocraft-server periodic.
2026-11-22 15:12:23 +00:00
..