forked from mtusi2026/mtusi2026lab2
The stack test for a stopped PostgreSQL asked for liveness 200 through the balancer, which only held while the balancer had not noticed the outage yet. Now the protected endpoints and readiness through the LB must answer 503 unavailable within 2 s, liveness is checked inside a replica with docker exec, the balancer must report zero UP servers within 2 s and answer liveness itself with 503 in the contract error format, the request id echoed and no X-Instance-Id. After PostgreSQL starts again every replica must be back in rotation without a restart. Stand helpers read the number of UP servers from the HAProxy stats, excluding the backend summary row, and reach a replica by container id, which survives the renumbering after a rolling update. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>