ЛР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, эксперименты
This commit is contained in:
2026-10-29 10:58:17 +03:00
parent 0ab3a341aa
commit cde3374d8a
74 changed files with 6231 additions and 25 deletions
+3
View File
@@ -1,3 +1,5 @@
# Personal study notes, not part of the submission
report_help.md
# Local/private state
.env
.env.*
@@ -16,6 +18,7 @@ backups/
# Runtime/build artifacts
.venv/
__pycache__/
.pytest_cache/
*.py[cod]
node_modules/
dist/