Files
mtusi2026lab4/evidence/failover.txt
T
zemiles c5a07dc253 ЛР 4 — БПИ2303 — Лазарев — на 4
Перенос lab3 и вложения в приватном S3 (SeaweedFS 4.50).

- POST /chats/{id}/attachments: потоковый приём PNG/JPEG в безымянный
  временный файл, SHA-256 на лету, лимиты 10 MiB / 40 Мпикс до чтения
  и декодирования, проверка MIME по содержимому, валидация filename.
- Порядок записи pending -> S3 PUT -> ready с компенсацией; janitor
  сверяет БД и bucket (dry-run, grace period, advisory lock).
- GET /attachments/{id} и /content только участникам чата, без redirect;
  attachment_ids в сообщениях с проверкой принадлежности чату.
- Отдельные S3-ключи api/janitor/admin с ограниченными правами,
  идемпотентный bootstrap bucket, служебные порты SeaweedFS закрыты.
- Ограничение параллельных S3 PUT и MALLOC_ARENA_MAX: пик RSS API
  178-189 -> 95-102 MiB; лимиты памяти и restart для SeaweedFS после OOM.
- Тесты уровня 4 (негативные, failover вложений, отказы S3/БД, память)
  и доказательства в evidence/, заполнен REPORT.md.
2026-11-07 01:44:58 +03:00

17 lines
1.2 KiB
Plaintext

# 2026-11-06T22:36:28Z round 1 make test-failover ACTION_SCRIPT=scripts/stop-one.sh
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 128, "failed_attempts": 0, "first_recovery_seconds": 3.616}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
exit=0
mtusi-lab4-api-1 Exited (0) 11 seconds ago
mtusi-lab4-api-2 Up About a minute (healthy)
# 2026-11-06T22:36:53Z round 2 make test-failover ACTION_SCRIPT=scripts/stop-one.sh
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 129, "failed_attempts": 0, "first_recovery_seconds": 3.514}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
exit=0
mtusi-lab4-api-1 Exited (0) 11 seconds ago
mtusi-lab4-api-2 Up 2 minutes (healthy)