Files
mtusi2026lab4/evidence/s3/restart.md
T
ricoromaandClaude Opus 5.5 7d340c0673 docs: add s3-storage evidence and report
- evidence/s3: bootstrap, privacy (make s3_check), gRPC without token,
  restart and SIGKILL, client failures, memory of 20 concurrent uploads
- evidence/tests: failure_checks with own S3, test_isolated prefix
  cleanup (red tests: no attachment_ids until attachments)
- REPORT.md: S3 role, services table, bootstrap, readiness
  dependencies, skeleton S3_* names, evidence rows, limitations
- refine expected-red counts in tasks, design and PLAN

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 20:31:35 +03:00

86 lines
4.1 KiB
Markdown
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.
# Рестарт стенда с S3 и SIGKILL сервера S3
- Дата: 2026-10-20, 17:17–17:18 UTC.
- Commit: `2e997f9`.
- Стенд: `make run_docker`, проект `mtusi-lab4`. Docker Desktop
29.8.2, compose 5.5.1, Apple M3 Pro.
- Спек `container-run`: «Рестарт hook-ом»; `object-storage`: «Рестарт
стенда», «Принудительное завершение». Design change `s3-storage`,
решение 9.
- Публичный `make test-persistence` до change `attachments` красный: он
загружает вложение до вызова hook (design, Context). Поэтому hook
проверен напрямую.
- Объекты пишет и читает клиент приложения `src/infra/s3` в консоли
(`persist_probe.py`, scratchpad) ключом API. Размеры объектов —
200 000 + i × 50 000 байт.
## 1. `scripts/restart.sh`
```
$ persist_probe.py write 3
written and confirmed: 3 objects
--- before
mtusi-lab4-api-1 7accadadfcdf 2026-10-20T17:09:56.87103075Z running
mtusi-lab4-api-2 27dc0f625cba 2026-10-20T17:09:56.957602042Z running
mtusi-lab4-haproxy-1 1d3b522e85fa 2026-10-20T17:09:57.069310542Z running
mtusi-lab4-migrate-1 beb1346b3d64 2026-10-20T17:14:53.472596304Z exited
mtusi-lab4-postgres-1 29c7b37863c1 2026-10-20T17:09:49.559951594Z running
mtusi-lab4-s3-1 53a2a1cd172f 2026-10-20T17:16:21.637346137Z running
mtusi-lab4-s3-bootstrap-1 d05a07be6b40 2026-10-20T17:15:30.66585646Z exited
mtusi-lab4-valkey-1 bd4329833fcc 2026-10-20T17:09:49.272486844Z running
$ time scripts/restart.sh
exit=0, 25 s
--- after
mtusi-lab4-api-1 7accadadfcdf 2026-10-20T17:17:47.007431801Z running
mtusi-lab4-api-2 27dc0f625cba 2026-10-20T17:17:47.076103343Z running
mtusi-lab4-haproxy-1 1d3b522e85fa 2026-10-20T17:17:47.188104885Z running
mtusi-lab4-migrate-1 beb1346b3d64 2026-10-20T17:17:44.385383967Z exited
mtusi-lab4-postgres-1 29c7b37863c1 2026-10-20T17:17:24.183151596Z running
mtusi-lab4-s3-1 53a2a1cd172f 2026-10-20T17:17:39.223372464Z running
mtusi-lab4-s3-bootstrap-1 d05a07be6b40 2026-10-20T17:17:44.2638513Z exited
mtusi-lab4-valkey-1 bd4329833fcc 2026-10-20T17:17:24.158704555Z running
$ docker compose logs --since 60s --no-log-prefix s3-bootstrap
s3-bootstrap: bucket messenger exists
s3-bootstrap: user api exists
s3-bootstrap: checks passed (api key put/get/delete; api key list and bucket create, anonymous get and list denied)
health/ready via LB: {"status":"ok"}
$ persist_probe.py verify
read back with the same SHA-256: 3/3; deleted
```
- Перезапущены LB, обе реплики, PostgreSQL, Valkey и S3: ID контейнеров
прежние, `StartedAt` у всех новый. `migrate` и `s3-bootstrap` снова
выполнены как зависимости `start api`.
- Hook занял 25 с при сроке 90 с, из них ~15 с — плавная остановка
SeaweedFS (`stop_grace_period: 20s`).
- Bootstrap после рестарта ничего не изменил («exists»), объекты
прочитаны с тем же SHA-256.
- В выводе hook нет ни `secret`, ни `password`, ни `key=`: grep по нему
дал 0 строк.
## 2. Плавная остановка S3
Из пробы клиента (`client.md`, 17:16):
```
docker compose stop s3: 15.6 s
```
Тот же стенд в apply (2026-10-20): `docker compose stop s3` — 15 с,
`ExitCode 0`, `OOMKilled false`. SIGKILL по сроку не понадобился.
## 3. SIGKILL сразу после подтверждённых записей
```
$ persist_probe.py write 20 && docker kill -s KILL mtusi-lab4-s3-1
written and confirmed: 20 objects
after kill: status exited, exit 137
$ docker compose up -d --wait s3
healthy in 3 s
$ persist_probe.py verify
read back with the same SHA-256: 20/20; deleted
```
Все 20 подтверждённых объектов пережили SIGKILL процесса. Отказ диска или
ВМ этим не покрыт: одна нода без реплик (`REPORT.md`, «Ограничения»).