Files
mtusi2026lab2/evidence/clean-clone.txt
T
ArtyomandClaude Opus 5.5 c8cb263c77 Retake the lab 4 evidence on the final code and finish the report
The level 3 and 4 evidence was taken on 24f9d61 and a774a2f, before the
lab 3 fixes were carried over and before the reconciler. Take all of it
again in one series on 81dd816, whose application and stand code is the
final one: a fresh clone runs the launch block of the report from secrets
to reset-data, then one stand from clean volumes gives the smoke, stack,
limits, lb-check, failover of each replica and of the upload replica,
persistence, S3 outage, S3 privacy, lost-answer retry, upload faults, all
stack checks, storage layout and three runs of the upload memory matrix.

The three memory runs keep the peak with three slots at 297-345 MiB
against 512 MiB at the limit without them, but at 40 uploads of 10 MiB
the wait for a slot nears the 8 s request timeout and one run of three
gave 7 of 80 a 503. Those timeouts left 67 invisible intents; the record
shows the reconciler seeing them as fresh and the sweep removing all of
them after the grace period.

Message write load is taken with tests/load.py from a container on the
edge network: 2 106 RPS, no errors, replicas and PostgreSQL at their CPU
limits. The first try from the macOS host is kept as a discarded attempt,
it ran out of ephemeral ports while the replicas answered every request.

The report gets the defense answers, the load section, the evidence
commits, the upload limit order as the pipeline applies it, medians in
the track 2 cost table and the proposals over the word limit; the evidence
index lists every file with its command and commit.

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

133 lines
7.7 KiB
Plaintext

date: 2026-10-30T04:27:15Z commit: 81dd816 dir: mtusi2026lab4-clean (свой compose-проект и volumes)
# шаги — команды блока «Запуск из чистого clone» REPORT.md; строки с пометкой «наблюдение» — проверки между шагами
$ git clone <repo> mtusi2026lab4-clean && cd mtusi2026lab4-clean && git checkout solution/bpi2303-kostylev
HEAD 81dd816 Archive the storage reconciler change
$ docker volume ls -q --filter label=com.docker.compose.project=mtusi2026lab4-clean | wc -l | tr -d ' ' # наблюдение, не шаг инструкции
0
$ make secrets
sh scripts/secrets.sh
создан secrets/postgres_password
создан secrets/database_url
создан secrets/cursor_secret
создан secrets/valkey_password
создан secrets/valkey.conf
создан secrets/cache_url
создан secrets/s3_root_user
создан secrets/s3_root_password
создан secrets/s3_access_key_id
создан secrets/s3_secret_access_key
создан .env из .env.example
$ sed LB_HTTP_PORT=18084 LB_STATS_PORT=24084 .env # отступление: 8080 на этой машине занят стендами других лаб
$ git status --short --ignored secrets .env # наблюдение, не шаг инструкции
!! .env
!! secrets/
$ docker compose --env-file .env config --quiet && echo valid
valid
$ make up
Container mtusi2026lab4-clean-postgres-1 Healthy
Container mtusi2026lab4-clean-s3-1 Healthy
Container mtusi2026lab4-clean-s3-init-1 Exited
Container mtusi2026lab4-clean-migrate-1 Exited
Container mtusi2026lab4-clean-postgres-1 Healthy
Container mtusi2026lab4-clean-migrate-1 Exited
Container mtusi2026lab4-clean-valkey-1 Healthy
Container mtusi2026lab4-clean-s3-1 Healthy
Container mtusi2026lab4-clean-s3-init-1 Exited
Container mtusi2026lab4-clean-api-1 Healthy
Container mtusi2026lab4-clean-api-2 Healthy
Container mtusi2026lab4-clean-lb-1 Healthy
make up: 11 s (сборка образа из кэша слоёв)
$ docker compose ps -a --format '{{.Service}} {{.State}} {{.Status}} {{.Ports}}' # наблюдение, не шаг инструкции
api running Up 4 seconds (healthy)
api running Up 4 seconds (healthy)
lb running Up 10 seconds (healthy) 127.0.0.1:18084->8080/tcp, 127.0.0.1:24084->8404/tcp
migrate exited Exited (0) 8 seconds ago
postgres running Up 10 seconds (healthy)
s3 running Up 10 seconds (healthy)
s3-init exited Exited (0) 4 seconds ago
valkey running Up 10 seconds (healthy)
$ docker compose logs --no-log-prefix migrate s3-init | grep -v '^$' | tail -8 # наблюдение, не шаг инструкции
{"version":"0001_init","event":"migration.applied","level":"info","ts":"2026-10-30T04:27:18.183850Z"}
{"version":"0002_idempotency_keys","event":"migration.applied","level":"info","ts":"2026-10-30T04:27:18.183962Z"}
{"version":"0003_attachments","event":"migration.applied","level":"info","ts":"2026-10-30T04:27:18.184008Z"}
{"version":"0004_attachment_quarantine","event":"migration.applied","level":"info","ts":"2026-10-30T04:27:18.184039Z"}
{"reason":"applied","event":"migration.completed","level":"info","ts":"2026-10-30T04:27:18.184066Z"}
s3-init: bucket=messenger-attachments anonymous=private policy=messenger-api lifecycle=abort-incomplete-uploads
$ curl -s "http://$(docker compose port lb 8404)/stats;csv" | awk -F, '$1 == "api" && $2 != "BACKEND" {print $2, $18}' | grep -v MAINT # наблюдение, не шаг инструкции
api1 UP
api2 UP
$ make test
python3 tests/smoke.py --base-url "http://127.0.0.1:18084"
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
$ make test-persistence ACTION_SCRIPT=scripts/restart.sh
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://127.0.0.1:18084"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
$ docker compose ps -a --format '{{.Service}} {{.State}} {{.RunningFor}} {{.Status}}' # наблюдение, не шаг инструкции
api running 24 seconds ago Up 3 seconds (healthy)
api running 24 seconds ago Up 3 seconds (healthy)
lb running 24 seconds ago Up 8 seconds (healthy)
migrate exited 24 seconds ago Exited (0) 7 seconds ago
postgres running 24 seconds ago Up 9 seconds (healthy)
s3 running 24 seconds ago Up 9 seconds (healthy)
s3-init exited 24 seconds ago Exited (0) 3 seconds ago
valkey running 24 seconds ago Up 9 seconds (healthy)
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://127.0.0.1:18084"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 128, "failed_attempts": 0, "first_recovery_seconds": 2.948}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
$ docker compose ps -a --format '{{.Service}} {{.Name}} {{.State}} {{.Status}}' api # наблюдение, не шаг инструкции
api mtusi2026lab4-clean-api-1 running Up 19 seconds (healthy)
api mtusi2026lab4-clean-api-2 exited Exited (0) 12 seconds ago
$ make restore
scripts/restore.sh
Container mtusi2026lab4-clean-api-1 Running
Container mtusi2026lab4-clean-api-2 Starting
Container mtusi2026lab4-clean-api-2 Started
Container mtusi2026lab4-clean-api-1 Waiting
Container mtusi2026lab4-clean-api-2 Waiting
Container mtusi2026lab4-clean-api-1 Healthy
Container mtusi2026lab4-clean-api-2 Healthy
$ make scenario SCENARIO=failover-upload
{'ok': True, 'upload_instance': 'b21945b926b7', 'download_instance': '6c9bf1e3b1a6', 'sha256_equal': True, 'hook_seconds': 2.713}
$ make scenario SCENARIO=s3-outage
{'ok': True, 'upload': 503, 'metadata': 200, 'download': 503, 'text_message': 201, 'health_ready': 200}
$ make s3-check
23
== 2026-10-30T04:28:17Z S3 privacy and bootstrap checks
== IAM/bucket snapshot (без секретов)
$ make reconcile
dry-run {'objects': 5, 'rows': 6} {'pending_fresh': 1} errors 0
$ make migrate
docker compose run --rm migrate
{"reason":"up to date","event":"migration.completed","level":"info","ts":"2026-10-30T04:28:21.735485Z"}
$ docker volume ls --format '{{.Name}}' --filter label=com.docker.compose.project=mtusi2026lab4-clean # наблюдение, не шаг инструкции
mtusi2026lab4-clean_pgdata
mtusi2026lab4-clean_s3data
mtusi2026lab4-clean_valkeydata
$ make down
1 Container mtusi2026lab4-clean-api-1 Removed
1 Container mtusi2026lab4-clean-api-2 Removed
1 Container mtusi2026lab4-clean-lb-1 Removed
1 Container mtusi2026lab4-clean-migrate-1 Removed
1 Container mtusi2026lab4-clean-postgres-1 Removed
1 Container mtusi2026lab4-clean-s3-1 Removed
1 Container mtusi2026lab4-clean-s3-init-1 Removed
1 Container mtusi2026lab4-clean-valkey-1 Removed
1 Network mtusi2026lab4-clean_backend Removed
1 Network mtusi2026lab4-clean_edge Removed
$ docker volume ls --format '{{.Name}}' --filter label=com.docker.compose.project=mtusi2026lab4-clean # наблюдение, не шаг инструкции
mtusi2026lab4-clean_pgdata
mtusi2026lab4-clean_s3data
mtusi2026lab4-clean_valkeydata
$ make reset-data
Volume mtusi2026lab4-clean_pgdata Removing
Volume mtusi2026lab4-clean_s3data Removing
Volume mtusi2026lab4-clean_valkeydata Removing
Volume mtusi2026lab4-clean_pgdata Removed
Volume mtusi2026lab4-clean_s3data Removed
Volume mtusi2026lab4-clean_valkeydata Removed
$ docker volume ls -q --filter label=com.docker.compose.project=mtusi2026lab4-clean | wc -l | tr -d ' ' # наблюдение, не шаг инструкции
0