Files
mtusi2026lab3/scripts/restart.sh
T
vest1ter cde3374d8a ЛР3: балансировка HAProxy, 2 реплики API, идемпотентность, отказоустойчивость (на 4)
- X-Instance-Id в каждом ответе; обязательный Idempotency-Key, таблица idempotency_keys
  (миграция 0002, одна транзакция, конкурентные повторы через уникальный индекс)
- graceful shutdown: SIGTERM -> ready=503 -> drain 3 с -> закрытие порта
- compose: lb (HAProxy) + api x2 без портов + разовый migrate + postgres, лимиты CPU/RAM
- хуки stop-one/restart/restore-replicas, scripts/experiments.py (failover, idempotency, rolling)
- свои тесты: 44 (13 новых); evidence: smoke, pytest, persistence, failover, эксперименты
2026-10-29 10:58:17 +03:00

10 lines
388 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# Hook для make test-persistence: перезапуск всего стенда (LB, API, PostgreSQL) с сохранением volumes.
set -eu
cd "$(dirname "$0")/.."
docker compose stop lb api postgres
# Порядок: postgres (healthy) -> migrate (exit 0) -> api (healthy) -> lb (healthy).
docker compose up -d --wait
docker compose ps --format '{{.Name}} {{.Status}}'