Files
mtusi2026lab3/openspec/changes/close-lab3-second-review-gaps/tasks.md
T
ArtyomandClaude Opus 5.5 e049c265b8 Reproduce a lost answer on the stand and enrich the run records
No failover run ever lost an answer, so the retry of an unconfirmed
write was only covered in process. make retry-check holds the chat row
with SELECT ... FOR UPDATE for 1.5 s (below lock_timeout), sends a
message with a 0.5 s client timeout, finds the replica whose request
waits on the lock in pg_stat_activity and then retries with the same
key and text through the LB, once with that replica alive and once
after docker kill. It checks the 201, a single copy with the id of the
retry answer and, for the live replica, the 201 it logged without a
client; created_at tells which attempt wrote the message. CI runs it.

failover-each and rolling-update now record the database size and a
docker stats snapshot in the background of the action, rolling-update
names the tag and id of every image it replaces, and scaling.py writes
started and the compose-up log marks in UTC with Z; the track README
states that the recorded rows are host time (MSK) and what
host-others.csv covers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
2026-10-30 05:43:44 +03:00

2.7 KiB
Raw Blame History

1. Платформа: остановка, готовность, журнал

  • 1.1 RequestPipeline: отмена задачи → request.cancelled, 503 unavailable в общем формате, если ответ не начат, затем отмена пробрасывается
  • 1.2 test_drain.py: прерванный при остановке запрос — 503, application/json, error.code = unavailable, request_id = X-Request-Id, непустой X-Instance-Id
  • 1.3 Порт Readiness, адаптер DatabaseReadiness с флагом DRAINING в shared/infrastructure/readiness.py, сборка в PlatformProvider, маршрут /health/ready через порт; тест состава модулей ядра
  • 1.4 gunicorn_conf.py: флаг из инфраструктуры, событие service.draining через StructlogLogger; failover-evidence.sh ищет его в логе
  • 1.5 openspec/config.yaml: карта модулей (readiness за портом)
  • 1.6 Проверка группы: make lint, make student-test, make check

2. Стенд и CI

  • 2.1 make up ждёт все реплики в LB (scripts/lb-wait.sh)
  • 2.2 CI: non-root по числовому uid docker top -eo pid,uid,comm; шаг make retry-check
  • 2.3 Проверка группы: make up и сразу make test-failover ACTION_SCRIPT=scripts/stop-one.sh; проверка non-root на стенде и на контейнере от root

3. Обвязка доказательств

  • 3.1 probe.py retry и make retry-check: потерянный ответ на живой и на убитой реплике → evidence/retry.json
  • 3.2 scripts/stand-usage.sh в действиях failover-each и rolling-update; тег и ID образа в rolling-update.sh
  • 3.3 scaling.py: started и метки compose-up-failed.log в UTC; evidence/track1/README.md — время прежних строк (MSK)
  • 3.4 Проверка группы: make lint, make check, sh -n скриптов, make retry-check на стенде

4. Доказательства и отчёт

  • 4.1 Уровни «3» и «4» заново на итоговом коде: checks.txt (с git diff --stat upstream/main контракта и тестов), student-tests.txt, стенд, make retry-check, make level4, чистый clone
  • 4.2 REPORT.md и evidence/README.md по новым доказательствам; числа отчёта сверены скриптом с evidence/
  • 4.3 Проверка группы: make check, make lint, make student-test, openspec validate --all --strict