forked from mtusi2026/mtusi2026lab3
49 lines
2.4 KiB
Plaintext
49 lines
2.4 KiB
Plaintext
# Сохранность: перезапуск балансировщика, реплик, PostgreSQL и Redis с сохранением volumes
|
||
# дата: 2026-10-30T18:43Z, commit: 269b449
|
||
# стенд: Apple M3 Pro, 11 CPU, 18 GB RAM, macOS 26.1, Docker 29.3.0, Compose 5.1.0
|
||
|
||
# до перезапуска
|
||
/mtusi-messenger-lab3-api-1 StartedAt=2026-10-30T18:43:31.186405878Z
|
||
/mtusi-messenger-lab3-api-2 StartedAt=2026-10-30T18:43:31.097777795Z
|
||
/mtusi-messenger-lab3-lb-1 StartedAt=2026-10-30T18:43:31.260557462Z
|
||
/mtusi-messenger-lab3-postgres-1 StartedAt=2026-10-30T18:43:24.360103334Z
|
||
/mtusi-messenger-lab3-redis-1 StartedAt=2026-10-30T18:43:24.358376875Z
|
||
|
||
$ cat scripts/restart.sh
|
||
#!/bin/sh
|
||
# Перезапускает балансировщик, все реплики API и оба хранилища. Volumes не трогает.
|
||
set -eu
|
||
cd "$(dirname "$0")/.."
|
||
docker compose --env-file .env restart postgres redis api lb
|
||
|
||
$ make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
|
||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||
|
||
# после перезапуска: новое время старта у всех контейнеров
|
||
/mtusi-messenger-lab3-api-1 StartedAt=2026-10-30T18:43:40.663879758Z
|
||
/mtusi-messenger-lab3-api-2 StartedAt=2026-10-30T18:43:40.704967008Z
|
||
/mtusi-messenger-lab3-lb-1 StartedAt=2026-10-30T18:43:40.433273008Z
|
||
/mtusi-messenger-lab3-postgres-1 StartedAt=2026-10-30T18:43:40.567209883Z
|
||
/mtusi-messenger-lab3-redis-1 StartedAt=2026-10-30T18:43:40.48552355Z
|
||
|
||
$ docker volume ls --filter name=mtusi-messenger-lab3
|
||
DRIVER VOLUME NAME
|
||
local mtusi-messenger-lab3_pgdata
|
||
local mtusi-messenger-lab3_redisdata
|
||
|
||
# повторный запуск миграций
|
||
$ docker compose --env-file .env run --rm migrate
|
||
Container mtusi-messenger-lab3-postgres-1 Running
|
||
Container mtusi-messenger-lab3-postgres-1 Waiting
|
||
Container mtusi-messenger-lab3-postgres-1 Healthy
|
||
Container mtusi-messenger-lab3-migrate-run-87950778e980 Creating
|
||
Container mtusi-messenger-lab3-migrate-run-87950778e980 Created
|
||
уже применена: 0001_init.sql
|
||
уже применена: 0002_idempotency.sql
|
||
|
||
$ psql: SELECT version FROM schema_migrations
|
||
0001_init.sql
|
||
0002_idempotency.sql
|