forked from mtusi2026/mtusi2026lab2
Compare commits
17
Commits
lab4
..
20e7759f87
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20e7759f87 | ||
|
|
0fc02496fe | ||
|
|
cd9d91550a | ||
|
|
447a6507f9 | ||
|
|
44d81fd80e | ||
|
|
1a171d0d0f | ||
|
|
2903d9dc73 | ||
|
|
95511002b1 | ||
|
|
12db77133f | ||
|
|
dc9256baf9 | ||
|
|
a8836ce8b5 | ||
|
|
e2ec3fe9af | ||
|
|
e60b4eac98 | ||
|
|
a41d6d39e8 | ||
|
|
5ae3d77152 | ||
|
|
a0d3947710 | ||
|
|
470d9d6f1e |
+43
-2
@@ -18,12 +18,22 @@ S3_ACCESS_KEY_ID_FILE=/run/secrets/s3_access_key_id
|
||||
S3_SECRET_ACCESS_KEY_FILE=/run/secrets/s3_secret_access_key
|
||||
MAX_UPLOAD_BYTES=10485760
|
||||
MAX_IMAGE_PIXELS=40000000
|
||||
BROKER_URL_FILE=/run/secrets/broker_url
|
||||
WORKER_CONCURRENCY=2
|
||||
JOB_MAX_ATTEMPTS=5
|
||||
JOB_TIMEOUT_SECONDS=60
|
||||
STAGING_RETENTION_SECONDS=86400
|
||||
OTEL_SERVICE_NAME=messenger-api
|
||||
# Worker must set a distinct service.name.
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
|
||||
OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=lab
|
||||
# Solution-specific: published LB ports, replica limits, workers and pool per replica,
|
||||
# LB queue per replica, drain window before closing the listener on SIGTERM, PostgreSQL
|
||||
# limits, load generator limits (profile bench), cursor key file. API_PORT/SHORTTTL_PORT of lab2 are gone:
|
||||
# only the load balancer is published.
|
||||
LB_HTTP_PORT=8080
|
||||
LB_STATS_PORT=8404
|
||||
LB_HTTP_PORT=18086
|
||||
LB_STATS_PORT=26085
|
||||
API_CPUS=1
|
||||
API_MEMORY=512m
|
||||
WEB_CONCURRENCY=2
|
||||
@@ -50,6 +60,37 @@ UPLOAD_SWEEP_INTERVAL_SECONDS=30
|
||||
UPLOAD_SWEEP_BATCH=100
|
||||
# Fixed glibc mmap threshold for the API: buffers above 128 KiB are returned to the system on free.
|
||||
MALLOC_MMAP_THRESHOLD_=131072
|
||||
# Solution-specific for lab5: RabbitMQ management UI on 127.0.0.1, backoff base of a transient
|
||||
# retry (doubles per attempt up to 60 s), relay poll and sweep intervals, worker limits and the
|
||||
# PostgreSQL pool of relay and worker. FAULT_POINT is set only by infra/compose.faults.yaml.
|
||||
BROKER_MANAGEMENT_PORT=26086
|
||||
JOB_BACKOFF_BASE_SECONDS=2
|
||||
OUTBOX_POLL_SECONDS=1
|
||||
SWEEP_INTERVAL_SECONDS=5
|
||||
WORKER_CPUS=2
|
||||
WORKER_MEMORY=1g
|
||||
PIPELINE_DB_POOL_MAX_SIZE=4
|
||||
# Solution-specific for lab5 grade 4: render time per job (the render process is killed after it),
|
||||
# address space of one render process (WORKER_MEMORY >= WORKER_CONCURRENCY * RENDER_MEMORY_MB plus
|
||||
# ~120 MiB of the worker itself), jobs per render process before it is replaced.
|
||||
RENDER_TIMEOUT_SECONDS=30
|
||||
RENDER_MEMORY_MB=448
|
||||
RENDER_TASKS_PER_CHILD=100
|
||||
# Solution-specific for lab6: host ports of Prometheus, Loki, Tempo and Grafana (127.0.0.1 only),
|
||||
# Prometheus retention, OTLP export timeout in seconds, metric export interval in ms, SDK queue
|
||||
# sizes, the bounded flush on shutdown; OTEL_SDK_DISABLED=true turns the SDK and instrumentations off.
|
||||
# relay and worker get OTEL_SERVICE_NAME messenger-relay and messenger-worker in compose.yaml.
|
||||
PROMETHEUS_PORT=26090
|
||||
LOKI_PORT=26310
|
||||
TEMPO_PORT=26320
|
||||
GRAFANA_PORT=26300
|
||||
PROMETHEUS_RETENTION=7d
|
||||
OTEL_SDK_DISABLED=false
|
||||
OTEL_EXPORTER_OTLP_TIMEOUT=2
|
||||
OTEL_METRIC_EXPORT_INTERVAL=10000
|
||||
OTEL_BSP_MAX_QUEUE_SIZE=2048
|
||||
OTEL_BLRP_MAX_QUEUE_SIZE=2048
|
||||
TELEMETRY_SHUTDOWN_SECONDS=2
|
||||
# Minimal client transfer rate, bytes/s: every body byte moved in either direction extends the
|
||||
# request deadline by 1/rate, so slow but steady uploads and downloads outlive REQUEST_TIMEOUT_SECONDS.
|
||||
MIN_TRANSFER_RATE_BYTES=131072
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Лабораторная 4
|
||||
## Лабораторная 6
|
||||
|
||||
Автор / группа: TODO
|
||||
Целевая оценка (3/4/5): TODO
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
- run: make student-test VENV=.venv
|
||||
|
||||
acceptance:
|
||||
name: Стенд Compose с RustFS за HAProxy, smoke, вложения, отказ реплики, рестарт и отказы зависимостей
|
||||
name: Стенд Compose с RabbitMQ, relay и worker за HAProxy, smoke, pipeline, отказ реплики, рестарт и отказы зависимостей
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -34,6 +34,17 @@ jobs:
|
||||
- name: Публичный smoke через балансировщик
|
||||
run: make test
|
||||
|
||||
- name: Топология брокера, consumer с prefetch и права клиентов
|
||||
run: make topology
|
||||
|
||||
- name: Уровни «3» и «4» pipeline — worker остановлен, рестарт брокера, дубль, S3, попытки, варианты и пределы, падения в окнах 2–5, аренда, replay, DLQ, jitter, retention
|
||||
run: |
|
||||
make suite-preflight
|
||||
make level4
|
||||
|
||||
- name: Сообщение задания в очереди, 409 до ready и SIGTERM relay и worker
|
||||
run: make pipeline-evidence
|
||||
|
||||
- name: Вложение после остановки принявшей его реплики и при недоступном S3
|
||||
run: |
|
||||
make scenario SCENARIO=failover-upload
|
||||
@@ -71,7 +82,8 @@ jobs:
|
||||
|
||||
- name: Наружу опубликован только балансировщик
|
||||
run: |
|
||||
docker compose ps --format '{{.Service}} {{.Ports}}' | awk '$2 != "" && $1 != "lb" {print; bad=1} END {exit bad}'
|
||||
docker compose ps --format '{{.Service}} {{.Ports}}' | awk '$2 != "" && $1 != "lb" && $1 != "broker" {print; bad=1} END {exit bad}'
|
||||
docker compose ps --format '{{.Service}} {{.Ports}}' | awk '$1 == "broker" && $2 !~ /^127\.0\.0\.1:/ {print; bad=1} END {exit bad}'
|
||||
|
||||
- name: Процессы работают не от root
|
||||
run: |
|
||||
@@ -87,6 +99,15 @@ jobs:
|
||||
case "${user%%:*}" in ""|0|root) exit 1 ;; esac
|
||||
done
|
||||
|
||||
- name: Корректная остановка relay и worker по SIGTERM
|
||||
run: |
|
||||
start=$(date +%s)
|
||||
docker compose stop -t 10 relay worker
|
||||
elapsed=$(( $(date +%s) - start ))
|
||||
codes=$(docker inspect -f '{{.State.ExitCode}}' $(docker compose ps -aq relay worker) | sort -u)
|
||||
echo "остановка за ${elapsed} с, коды завершения ${codes}"
|
||||
test "$elapsed" -le 10 && test "$codes" = "0"
|
||||
|
||||
- name: Корректная остановка реплик API по SIGTERM
|
||||
run: |
|
||||
start=$(date +%s)
|
||||
|
||||
@@ -1,82 +1,61 @@
|
||||
## Что это за репозиторий
|
||||
|
||||
Skeleton лабораторной 4 курса «Мессенджер под нагрузкой» (МТУСИ, 7 независимых лаб) и решение в ветке `solution/bpi2303-kostylev`. Skeleton даёт задание (`README.md`), нормативный контракт (`contracts/`) и публичные black-box проверки (`tests/`). Реализация API, Dockerfile, compose-стенд, конфигурация балансировщика и S3, миграции, хуки отказов и собственные тесты — студенческие; решение лабы 4 построено переносом решения лабы 3.
|
||||
Skeleton лабораторной 6 курса «Мессенджер под нагрузкой» (МТУСИ, 7 независимых лаб) и решение в ветке `solution/bpi2303-kostylev`. Skeleton даёт задание (`README.md`), нормативный контракт (`contracts/`, включая `contracts/observability.md`) и публичные black-box проверки (`tests/`). Реализация API, relay, worker, Dockerfile, compose-стенд, конфигурация балансировщика, S3, брокера и стека наблюдаемости, миграции, хуки отказов и собственные тесты — студенческие; решение лабы 6 построено переносом решения лабы 5.
|
||||
|
||||
Лаба 4: вложения-изображения в сообщениях. Метаданные вложений живут в PostgreSQL, байты — в приватном bucket S3-совместимого хранилища **RustFS** внутри стенда, а не в БД и не на диске реплики. `POST /api/v1/chats/{chat_id}/attachments` принимает сырые байты одного PNG/JPEG (≤10 MiB, ≤40 млн пикселей, тип по содержимому) и отвечает `201 ready` только после записи объекта и фиксации метаданных; скачивание идёт только через API участникам чата. Сообщение несёт `attachment_ids`. Остаётся всё из лабы 3: HAProxy перед ≥2 репликами, `X-Instance-Id`, обязательный `Idempotency-Key`, хуки остановки реплики и рестарта стенда.
|
||||
Лаба 6: наблюдаемость всей системы, включая фоновую обработку. Бизнес-API не меняется (контракт 1.6.0). API, relay и worker инициализируют **OpenTelemetry SDK** в каждом процессе после fork (gunicorn-воркер, процесс relay, процесс worker) и отдают OTLP/HTTP в **OTel Collector** (`otelcol-contrib`); Collector раскладывает метрики в **Prometheus 3** (OTLP-приём), логи в **Loki 3** (OTLP `/otlp`), трассы в **Tempo 2**; **Grafana 12** только показывает и связывает их, datasources и dashboards приходят из provisioning в Git. HTTP-метрики и server spans даёт инструментация FastAPI, client spans БД — инструментация asyncpg, consumer spans — `RabbitTelemetryMiddleware` FastStream. Логи идут через порт `Logger` (structlog → stdout JSON и OTLP) с `trace_id`/`span_id`, без тел сообщений и секретов. Остаётся всё из лаб 1–5: HAProxy перед ≥2 репликами, PostgreSQL, Valkey, RustFS, RabbitMQ, outbox, relay, worker с арендой и вариантами, хуки остановки реплики и рестарта стенда.
|
||||
|
||||
## Команды
|
||||
|
||||
```sh
|
||||
make check # offline: структура skeleton, JSON, локальные $ref, синтаксис Python, версия 1.4.0
|
||||
make validate # полная валидация OpenAPI 3.1: openapi-spec-validator из .venv (make install); PYTHON= — свой интерпретатор
|
||||
make check # offline: структура skeleton, JSON, локальные $ref, синтаксис Python, версия 1.6.0
|
||||
make validate PYTHON=.venv/bin/python # полная валидация OpenAPI 3.1 и jobs.schema.json (venv с requirements-dev.txt)
|
||||
make install # uv sync --group dev
|
||||
make lint # ruff check + ruff format --check + ty check; обязательно перед commit
|
||||
make student-test # собственные тесты (поднимают одноразовые PostgreSQL, Valkey и RustFS в Docker)
|
||||
make student-test PYTEST_ARGS='-v -k drain' # выборка тестов с именами
|
||||
make student-test # собственные тесты (одноразовые PostgreSQL, Valkey, RustFS и RabbitMQ в Docker)
|
||||
|
||||
make secrets # локальные secrets/* (включая root и API-ключи S3) и .env из .env.example
|
||||
make up # docker compose up -d --build --wait: postgres, valkey, s3 → migrate, s3-init → api ×2 → lb; затем ждёт все реплики UP в LB
|
||||
make test # публичный smoke через LB (BASE_URL по умолчанию — docker compose port lb 8080, без стенда http://localhost:8080)
|
||||
make test-persistence ACTION_SCRIPT=scripts/restart.sh # рестарт lb, api, postgres, valkey, s3 с сохранением volumes
|
||||
make secrets # локальные secrets/* (lab5 + Grafana и DSN Collector) и .env
|
||||
make up # docker compose build, затем up -d --wait: хранилища, broker, стек наблюдаемости → migrate, s3-init → api ×2, relay, worker → lb
|
||||
make obs-validate # otelcol validate, promtool check config, loki/tempo verify, JSON dashboards
|
||||
make telemetry-check # Grafana provisioning, запрос → лог → трасса, job → трасса и лог worker, утечки
|
||||
make test # публичный smoke через LB (BASE_URL, по умолчанию http://localhost:8080)
|
||||
make test-persistence ACTION_SCRIPT=scripts/restart.sh # рестарт lb, api, relay, worker и postgres, valkey, s3, broker с volumes
|
||||
make test-failover ACTION_SCRIPT=scripts/stop-one.sh # остановка реплики TARGET_INSTANCE_ID под запросами
|
||||
make test-faults # тесты стенда через LB (make faults-evidence → evidence/faults.txt)
|
||||
make restore # вернуть остановленные реплики и дождаться их в ротации LB
|
||||
make limits # лимиты, порты, секреты, volumes и сети всех сервисов против политики → evidence/limits.txt
|
||||
make lb-check # один токен на обеих репликах и 20 гонок одного Idempotency-Key через LB
|
||||
make retry-check # потерянный ответ (запись ждёт блокировку чата) на живой и на убитой реплике, повтор тем же ключом
|
||||
make scenario SCENARIO=failover-upload # upload → стоп обслужившей реплики → download через другую, SHA-256
|
||||
make scenario SCENARIO=s3-outage # S3 остановлен: upload/download 503, тексты работают
|
||||
make s3-check # приватный bucket вне API, ограниченные ключи API и сверки, консоль, повторный bootstrap
|
||||
make upload-faults # «4»: негативный suite через LB, компенсация, уборка после grace, обрыв и зависание тела
|
||||
make upload-memory ARGS='--out evidence/upload-memory/run1' # «4»: пик памяти реплик и LB при 10/20/40 загрузках 1 и 10 MiB
|
||||
make load-evidence # tests/load.py ×3 клиентом-контейнером в сети edge → evidence/load.txt, evidence/load/
|
||||
make overload-leftovers # после upload-memory: намерения от 503, сверка и уборка после grace → evidence/overload-leftovers.txt
|
||||
make clean-clone-evidence # блок «Запуск из чистого clone» REPORT.md в свежем клоне рядом → evidence/clean-clone.txt
|
||||
make reconcile ARGS="--apply" # трек 2: сверка PostgreSQL ↔ S3 (без ARGS — dry-run), one-off сервис reconciler
|
||||
make reconcile-demo # трек 2: внедрение ошибок, dry-run/apply/повтор, безопасность, нагрузка → evidence/reconcile/
|
||||
make reconcile-cost # трек 2: стоимость обхода 1k/10k/30k/100k × 3 (чистый стенд) → evidence/reconcile/cost/
|
||||
make down # остановка без удаления данных (с профилями bench, tools, reconcile)
|
||||
make level3 # сценарии уровня «3» лабы 5 (scripts/pipeline_suite.py) → evidence/level3.json
|
||||
make down # остановка без удаления данных; make reset-data — намеренное удаление volumes
|
||||
```
|
||||
|
||||
`tests/*.py` и `scripts/*.py` — только stdlib, синтаксис Python 3.9 (`make check` разбирает их системным `python3`). Проверки сами не поднимают стенд. Хуки `scripts/stop-one.sh` и `scripts/restart.sh` запускаются тестом без shell, поэтому исполняемые и с shebang. Данные не удаляются автоматически: каждый прогон smoke создаёт новых синтетических пользователей и вложения.
|
||||
`tests/*.py` и `scripts/*.py` — только stdlib, синтаксис Python 3.9 (`make check` разбирает их системным `python3`). Проверки сами не поднимают стенд. Хуки `scripts/stop-one.sh` и `scripts/restart.sh` запускаются тестом без shell, поэтому исполняемые и с shebang. Адреса Prometheus, Loki, Tempo и Grafana для `scripts/obs_check.py` — переменные `PROMETHEUS_URL`, `LOKI_URL`, `TEMPO_URL`, `GRAFANA_URL` (по умолчанию стандартные порты на `127.0.0.1`).
|
||||
|
||||
## Архитектура skeleton
|
||||
|
||||
- `lab.json` — единственный источник номера лабы (4). От него зависят `scripts/check_contract.py` (`info.version == 1.4.0`, путь `/api/v1/attachments/{attachment_id}`, `X-Instance-Id` во всех ответах) и `tests/client.py` (ветки `LAB>=4`: upload `tests/fixtures/sample.png`, сообщение с `attachment_ids`, скачивание вторым участником, `404` постороннему).
|
||||
- `tests/client.py` шлёт `Accept: application/json` на каждый запрос, включая скачивание картинки, и считает любой `30x` ошибкой: content negotiation и redirect на S3 не делаются.
|
||||
- `tests/resilience.py`: перед хуком загружается `sample.png`; после `persistence` метаданные и `/content` запрашиваются **один раз** без повторов с таймаутом 2 с, поэтому хук рестарта ждёт здоровья S3. В `failover` `TARGET_INSTANCE_ID` — реплика, обслужившая первое **сообщение**, а не upload; остановку реплики, принявшей upload, доказывает `scripts/lab4_scenarios.py failover-upload`.
|
||||
- `contracts/infrastructure.json` — роли `api` (≥2, без локального состояния), `postgres` (метаданные, persistent volume), `load_balancer`, `s3` (приватный bucket, persistent volume), опциональный `redis_or_valkey`. `compose.example.yaml` — только worksheet ролей.
|
||||
- `lab.json` — единственный источник номера лабы (6). От него зависят `scripts/check_contract.py` (`info.version == 1.6.0`) и `tests/client.py` (ветки `LAB>=5`: upload `202 queued`, ожидание `ready` до 60 с, ровно один `thumbnail` 256×160). Публичных проверок телеметрии нет: наблюдаемость доказывается своими скриптами и `evidence/`.
|
||||
- `tests/` байт в байт как в лабе 5. `contracts/openapi.json` отличается только `info.title` и `info.version`.
|
||||
- `contracts/observability.md` — нормативный набор сигналов (уровни «3» и «4»), resource attributes, запрещённые labels метрик и запрещённое содержимое telemetry, alerts и инциденты. `infra/otel/README.md` — что лежит в Git (Collector, storage, provisioning, dashboards, rules).
|
||||
- `contracts/infrastructure.json` — роли лабы 5 плюс `otel_collector`, `telemetry_storage` (метрики, логи, трассы, persistent volume) и `grafana` (provisioning в Git). `compose.example.yaml` — только worksheet ролей.
|
||||
|
||||
## Ключевые правила контракта (lab4)
|
||||
## Ключевые правила контракта (lab6)
|
||||
|
||||
- Upload: `POST /api/v1/chats/{chat_id}/attachments?filename=…`, тело — сырые байты (не multipart), `Content-Type: image/png|image/jpeg`. Сначала `401`, затем объявленный `Content-Length` (`413`). Дедлайн запроса продлевается переданными байтами тела по `MIN_TRANSFER_RATE_BYTES` (128 KiB/s): медленный, но идущий upload и скачивание не обрываются. `>10485760` байт или `>40 000 000` пикселей — `413`; тип по содержимому не совпал, битый файл, иной `Content-Type` — `415`; `filename` пустой, пробельный, длиннее 255 code points или с `/`, `\`, NUL, управляющими символами — `400`. Object key назначает сервер. `201 Attachment` (`status=ready`, `variants=[]`, `error_code=null`, lowercase `sha256`, `size_bytes` оригинала) — только после записи в S3 и `COMMIT` метаданных. Кода `409` у upload нет.
|
||||
- `GET /api/v1/attachments/{id}` и `/content?variant=original` — только участникам чата вложения, посторонний и неизвестный id — `404`. Скачивание отдаёт исходные байты с истинным `Content-Type`, без redirect, с `X-Request-Id` и `X-Instance-Id`.
|
||||
- `Message.attachment_ids` обязателен в каждом ответе (`[]` у текстовых, в том числе в replay и истории). `CreateMessage.attachment_ids` — 0–10 уникальных UUID (иначе `400`), только вложения этого чата (иначе `404`); `text=""` допустим только с вложением. Отсутствующий `attachment_ids` и `[]` — одно тело для `Idempotency-Key`.
|
||||
- Сохраняются правила lab3 (`X-Instance-Id`, `Idempotency-Key`, LB не повторяет `POST /users`, `/chats`, upload), lab2 (`Basic` только на входе, `Bearer` дальше, `WWW-Authenticate` по пути, logout `204`, TTL) и lab1 (формат ошибки, посторонний → `404`, keyset `(created_at, id)`, время RFC 3339 с `Z`).
|
||||
- Resource attributes: `service.name` (`messenger-api`, `messenger-worker`, `messenger-relay`), `service.version`, `service.instance.id` (уникален на процесс: `<hostname>-<pid>`), `deployment.environment.name=lab`.
|
||||
- Метрики не получают labels `user_id`, `chat_id`, `message_id`, `attachment_id`, `request_id`, сырой URL, filename, текст; маршрут — шаблон (`/api/v1/chats/{chat_id}/messages`). HTTP duration — histogram в секундах (`http.server.request.duration`, `OTEL_SEMCONV_STABILITY_OPT_IN=http`).
|
||||
- Логи: timestamp, severity, `service.name`, `event`, `trace_id`/`span_id` при активном span. В telemetry никогда не попадают пароли, `Authorization`, токен сессии, тело сообщения, байты изображения, filename, ключи и подписанные URL; захват HTTP-заголовков выключен, Collector дополнительно редактирует подозрительные ключи.
|
||||
- Экспорт телеметрии никогда не блокирует запрос: только `Batch*Processor` и `PeriodicExportingMetricReader`, короткий таймаут OTLP. `/health/ready` не зависит от Collector, хранилищ телеметрии и Grafana. `OTEL_SDK_DISABLED=true` выключает SDK целиком.
|
||||
- Тело ошибки остаётся `{"error":{"code","message","request_id"}}` с `additionalProperties: false`: `trace_id` в тело и схемы не добавляется.
|
||||
- Сохраняются правила lab5 (outbox, `202 queued`, `ack` после `COMMIT`, ключ эффекта, `409` на `/content` до `ready`), lab4, lab3 (`X-Instance-Id`, `Idempotency-Key`), lab2 и lab1.
|
||||
|
||||
## Правила работы с репозиторием
|
||||
|
||||
- Поздние исправления ЛР3 перенесены из immutable snapshot `ba78cf6da439a4ec60fd59389583b38285b0b2b1`; диапазон от `f591fa64e525679a31c9db7f942d36c789e1a12f` и применимость evidence описаны в `evidence/forward-port.md`.
|
||||
- Только свой Compose project `mtusi2026lab4` либо `hlpipe-lab4-*` под разрешённым working_dir; HTTP 18084, остальные host-порты 24000–24999. `NO_PROXY` и `no_proxy`: localhost,127.0.0.1,::1. Чужие контейнеры не останавливать, WIP и volumes сохранять. Совместный Docker допустим; эксклюзивность только в финальном release.
|
||||
- Runner назначает одного агента переноса и реализации 3→4→5 с evidence, затем review → отдельный fix при major → re-review, отдельный report и одного агента нагрузки/публикации. Грейды одной лабы последовательны; review/report предыдущей могут идти параллельно реализации следующей. Самостоятельных агентов, push и Telegram нет; runner/state не менять. Публикация только в назначенной фазе PUBLICATION в private MTUCI-Labs.
|
||||
- Исправлять критичное: major — доказанная угроза безопасности, данным, доступности или неработающий обязательный сценарий. Прочие minor остаются в findings и ограничениях REPORT и не блокируют этап. Пригодные измерения сохраняются; повторяется только затронутая или признанная непригодной серия с указанной причиной и фоном нагрузки.
|
||||
- Не менять и не ослаблять `contracts/`, `tests/`, `README.md`, `COURSE.md`, рубрику. Расхождение оформляется вопросом преподавателю.
|
||||
- Код — `src/messenger/`, миграции — `alembic/versions/NNNN_*.py`, конфигурация LB, нагрузки и S3 — `infra/`, хуки и обвязка стенда — `scripts/`, собственные тесты — `student-tests/`, обезличенные доказательства — `evidence/`.
|
||||
- PostgreSQL — SQLAlchemy 2 async с asyncpg как драйвером; ORM-модели внутри зон, Alembic принимает legacy-схему только после сверки журнала и каталога.
|
||||
- Не менять и не ослаблять `contracts/`, `tests/`, `README.md`, `COURSE.md`, `infra/README.md`, `infra/otel/README.md`, рубрику. Расхождение оформляется вопросом преподавателю.
|
||||
- Код — `src/messenger/`, миграции — `src/messenger/migrations/NNNN_*.sql`, конфигурация LB, нагрузки, S3, брокера и наблюдаемости — `infra/` (`infra/otel`, `infra/prometheus`, `infra/loki`, `infra/tempo`, `infra/grafana`), хуки и обвязка стенда — `scripts/`, собственные тесты — `student-tests/`, обезличенные доказательства — `evidence/`.
|
||||
- Без комментариев в коде; отступы — пробелы (`[tool.ruff.format]`); Python 3.14 без `from __future__ import annotations` и `TYPE_CHECKING`.
|
||||
- Порты реплик API и S3 наружу не публикуются: только LB. Нет `container_name`, `hostname` и общего `INSTANCE_ID` у сервиса `api`. Root-ключи S3 есть только у `s3`, `s3-init` и `s3-cli`; API получает отдельный ключ только на объекты bucket (`Get/Put/DeleteObject`), сверка — свой ключ (`ListBucket`, `Get/DeleteObject`). `s3-init` и `s3-cli` работают от uid 65534, `migrate` и `reconciler` — с `init: true`.
|
||||
- `REPORT.md`: команды из чистого clone, архитектура, таблица «критерий → команда → наблюдение → файл», таблица отказов. PASS без команды не доказательство; для отказов — какой контейнер реально остановлен (`docker ps -a`).
|
||||
- Отчётный этап меняет только `REPORT.md`, `AGENTS.md` и `evidence/**/*.md`; код, конфиги, OpenSpec и сырые измерения не меняет. Docker и нагрузку не запускает. `make student-test` поднимает зависимости: сохранённый результат или collection не выдаётся за новый полный прогон.
|
||||
- Ветка `solution/bpi2303-kostylev`, коммиты на английском, перед каждым — `make lint`. Никогда не коммитить `.env`, `secrets/`, токены, ключи S3, volumes, дампы.
|
||||
- Наружу публикуются только LB, UI брокера, Prometheus, Loki, Tempo и Grafana на `127.0.0.1`; порты реплик API, OTLP и self-metrics Collector не публикуются. Порты задаются переменными `.env`, дефолты compose — стандартные.
|
||||
- `REPORT.md`: команды из чистого clone, архитектура, таблица «критерий → команда → наблюдение → файл», таблица отказов, сопоставление сигналов `observability.md` реальным именам метрик. PASS без команды не доказательство.
|
||||
- Ветка `solution/bpi2303-kostylev`, коммиты на английском, перед каждым — `make lint`. Никогда не коммитить `.env`, `secrets/`, токены, пароли Grafana, ключи S3, пароли брокера, volumes, дампы.
|
||||
|
||||
## Уровни оценки
|
||||
|
||||
Цель — **«5»**, трек 2 «Согласованность двух хранилищ (reconciler)». На snapshot `7a0ebac2aa9e1d8602054ca4c7c1b0c23d3bfad4` ревью прошло без открытых major. Финальная validation на `5e49502ae78fa48b992c97418e490666c699726d` с идентичным runtime закрыла динамический долг обоих PNG-фиксов: `evidence/load-validation.md`. Сохранён minor Unicode-surrogate → HTTP 500 (`src/messenger/messaging/entrypoints/schemas.py:35`, `evidence/forward-final-2026-11-06/known-minor-http.txt`).
|
||||
Решение заявлено на **«5»** с треком 1 «Цена наблюдаемости»; таблица доказательств — в `REPORT.md`.
|
||||
|
||||
Таблица критериев — в `REPORT.md`, команды и SHA — в `evidence/README.md`. Новая серия использует отдельный разрешённый project со свежими volumes; `reset-data`, `down -v`, reset/clean и удаление пользовательских данных запрещены. После Docker-этапа остановить только свои стенды, сохранив volumes. При изменениях проверять применимость по diff: повторять лишь затронутые/непригодные серии с причиной и фоном. Документационный коммит измерений не обесценивает.
|
||||
|
||||
Исторические upload-memory и конкурентные upload до PNG-фиксов не доказывают RAM/производительность нового инспектора. Финальная validation выполнена: 721 собственная проверка (719 + адресный повтор 2 setup errors RustFS), 7 stack, PNG/JPEG через LB/RustFS; матрица 3 слота × 1/10 MiB × 10/20/40 клиентов ×3: 840/840×201, API ≤440 MiB, OOM 0; 10 PNG 40 MP RGBA16: 10×201, API ≤270,828 MiB; upload при сверке: 3341×201, 67 проходов, lost_ready=0. Сырьё — `evidence/png-final-2026-11-06/`. Эти пригодные серии повторять без нового изменения/обоснованной непригодности запрещено. Контроль 64/3 оставлен историческим. 27 пригодных cost-замеров reconciler на `3402fd69d4922e500035a204d957be2cccaeb85a` сохраняются: измеряемый путь не менялся. Отрицательный вывод о линейности времени и разброс deep 100k не скрываются.
|
||||
|
||||
- **3** — RustFS и приватный bucket в общем стенде, метаданные в PostgreSQL; upload `201 ready` после записи и `COMMIT`, побайтное скачивание вторым участником, `404` постороннему, `403` анонимному GET в S3; лимиты 10 MiB / 40 MP, тип по содержимому, опасные `filename`; upload → стоп обслужившей реплики → download через другую; restart с volumes; недоступный S3 → `503` при работающих текстах; минимум lab3 сохранён.
|
||||
- **4** — негативные тесты файлов без `500`; компенсация сбоя между S3 и БД под блокировкой строки и фоновая уборка намерений `pending` старше `UPLOAD_GRACE_SECONDS` (`SKIP LOCKED`, объект раньше строки); слоты загрузки на воркер, ограниченные буферы сокетов LB и API, фиксированный порог `mmap` glibc и замер ≥10 одновременных загрузок; идемпотентный bootstrap, ограниченные ключи API, закрытая консоль, проверка приватности вне API.
|
||||
- **5** — трек 2: one-off `reconciler` (`python -m messenger.attachments.entrypoints.reconcile`, по умолчанию `--dry-run`) сливает отсортированный листинг bucket и keyset-страницы `attachments` по `object_key` (O(N) сравнений, O(страница) памяти; линейность времени в замерах не подтвердилась); объект без строки старше grace + skew удаляется после повторной проверки строки, готовые строки без объекта или с другими байтами уходят в карантин (миграция `0004`, `/content` → `404`) и не удаляются, `pending` старше grace удаляется (объект, затем строка), карантин снимается только после совпавшего SHA-256 объекта (и без `--deep`); удаление намерения — `audit.attachment_discarded reason=reconcile`; SQL-страниц `⌈N/страница⌉`; один проход за раз (`pg_try_advisory_lock`); повторный `--apply` — 0 действий; стоимость обхода 1k/10k/30k/100k объектов с закреплёнными CPU и отбраковкой прогонов с чужой нагрузкой (`evidence/reconcile/`).
|
||||
- **3** — минимум lab5 работает при включённой телеметрии; Collector, Prometheus, Loki, Tempo и Grafana в общем стенде с volumes и provisioning из Git; API, relay и worker отдают OTLP; RPS/errors/duration API, jobs по исходу и duration worker; структурные логи с `trace_id`/`span_id`; реальные server и consumer spans; импортируемые dashboards; нет секретов и тел в telemetry; запрос → трасса и лог, job → трасса и лог worker.
|
||||
- **4** — W3C trace context API → outbox → broker → worker (producer/consumer), цепочка до S3/DB с retry; p50/p95/p99 из histogram, доля ошибок, queue depth и возраст старейшей job, DB pool, saturation worker, CPU/RAM; SLI/SLO, alert rules error rate и queue lag (firing → resolved); memory_limiter, batch, ограниченные очереди, отказ хранилищ телеметрии; два разобранных инцидента.
|
||||
- **5** — трек 1: telemetry off / on / head sampling / tail sampling / сбалансированная конфигурация при одинаковой open-loop нагрузке — latency с клиента, CPU/RAM вне телеметрии, объём ingest, потери spans и захват вброшенных ошибок и медленных запросов.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Памятка преподавателю — лабораторная 4
|
||||
# Памятка преподавателю — лабораторная 6
|
||||
|
||||
## Что подготовлено
|
||||
|
||||
|
||||
@@ -10,19 +10,30 @@ COMPOSE ?= docker compose
|
||||
RATE ?= 100
|
||||
FROM_REV ?=
|
||||
SHIFT ?= 0
|
||||
SCRIPTS_PY = scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py \
|
||||
scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py
|
||||
SCRIPTS_PY = scripts/obs_incidents.py scripts/obs_recovery.py scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py \
|
||||
scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py \
|
||||
scripts/make_images.py scripts/pipeline_suite.py scripts/pipeline_evidence.py
|
||||
SCENARIO ?= failover-upload
|
||||
PSQL = $(COMPOSE) exec -T postgres psql -U messenger -d messenger -X -q
|
||||
OBS_CHECK = $(PYTHON) scripts/obs_check.py
|
||||
APP_METRICS = {job=~"messenger-.*"}
|
||||
|
||||
TRACK2_OUTPUT ?= evidence/track2.json
|
||||
TRACK2_SCENARIOS = smoke_pipeline,duplicate_after_ready,crash_commit_publish,crash_publish_confirm,crash_after_s3_before_commit,crash_after_commit_before_ack,lease_expiry_fencing,crash_before_side_effect,worker_kill_mid_task,duplicate_in_flight,reorder_attempts,reorder_versions,stale_after_new_version
|
||||
PIPELINE_VERSION ?= 2
|
||||
PYTEST_ARGS ?=
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover \
|
||||
install lint format typecheck student-test \
|
||||
secrets up down reset-data migrate ps logs restore lb-check failover-evidence stack-evidence \
|
||||
persistence-evidence storage-evidence cache-evidence test-faults faults-evidence seed explain retry-check \
|
||||
limits detection failover-each rolling-update level4 \
|
||||
persistence-evidence storage-evidence cache-evidence test-faults seed explain \
|
||||
limits detection failover-each rolling-update lab4-level4 \
|
||||
scenario s3-check attachments-evidence upload-faults upload-memory \
|
||||
reconcile reconcile-demo reconcile-cost load-evidence clean-clone-evidence overload-leftovers
|
||||
images queues topology worker-stop worker-start broker-restart suite-preflight level3 \
|
||||
pipeline-evidence level4 replay failed dlq \
|
||||
obs-validate telemetry-check \
|
||||
faults-evidence retry-check reconcile reconcile-demo reconcile-cost load-evidence \
|
||||
clean-clone-evidence overload-leftovers
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
@@ -31,8 +42,16 @@ help:
|
||||
@echo "install/lint/typecheck/student-test: студенческий тулчейн"
|
||||
@echo "secrets/up/down/migrate/ps/logs: стенд Docker Compose; reset-data: намеренное удаление volumes"
|
||||
@echo "restore: вернуть остановленные реплики; lb-check: реплики на одном токене и 20 гонок одного ключа"
|
||||
@echo "lab4-level4 = limits, lb-check, detection, failover-each, rolling-update [FROM_REV=<коммит>]; RATE=$(RATE) rps"
|
||||
@echo "scenario SCENARIO=failover-upload|s3-outage → evidence/<сценарий>.json; s3-check; attachments-evidence"
|
||||
@echo "upload-faults: негативный suite, компенсация, уборка, обрыв и зависание загрузки против стенда"
|
||||
@echo "upload-memory: пик памяти реплик при 10/20/40 одновременных загрузках 1 и 10 MiB → evidence/upload-memory/"
|
||||
@echo "lab5: queues, topology, worker-stop/worker-start, broker-restart, images, suite-preflight, level3, level4"
|
||||
@echo "lab5 оператор: failed (реестр), replay ID=<attachment_id>, dlq (просмотр DLQ без извлечения)"
|
||||
@echo "lab6: obs-validate (конфиги Collector, Prometheus, Loki, Tempo, dashboards); telemetry-check → evidence/*.json"
|
||||
|
||||
@echo "retry-check: потерянный ответ на живой и на убитой реплике, повтор тем же ключом"
|
||||
@echo "level4 = limits, lb-check, detection, failover-each, rolling-update [FROM_REV=<коммит>]; RATE=$(RATE) rps"
|
||||
@echo "lab4-level4 = limits, lb-check, detection, failover-each, rolling-update [FROM_REV=<коммит>]; RATE=$(RATE) rps"
|
||||
@echo "scenario SCENARIO=failover-upload|s3-outage → evidence/<сценарий>.json; s3-check; attachments-evidence"
|
||||
@echo "upload-faults: негативный suite, компенсация, уборка, обрыв и зависание загрузки против стенда"
|
||||
@echo "upload-memory ARGS='--out evidence/upload-memory/runN': пик памяти реплик при 10/20/40 загрузках 1 и 10 MiB"
|
||||
@@ -85,9 +104,12 @@ student-test:
|
||||
|
||||
secrets:
|
||||
sh scripts/secrets.sh
|
||||
sh scripts/broker-secrets.sh
|
||||
sh scripts/secrets-lab6.sh
|
||||
|
||||
up: secrets
|
||||
$(COMPOSE) up -d --build --wait
|
||||
$(COMPOSE) build
|
||||
$(COMPOSE) up -d --wait
|
||||
scripts/lb-wait.sh
|
||||
|
||||
down:
|
||||
@@ -136,7 +158,7 @@ endif
|
||||
--out evidence/rolling$(if $(FROM_REV),-from-$(FROM_REV)) \
|
||||
-- scripts/rolling-update.sh
|
||||
|
||||
level4: limits lb-check detection failover-each rolling-update
|
||||
lab4-level4: limits lb-check detection failover-each rolling-update
|
||||
|
||||
scenario:
|
||||
$(PYTHON) scripts/lab4_scenarios.py $(SCENARIO) --base-url "$(BASE_URL)" --restore --output evidence/$(SCENARIO).json
|
||||
@@ -209,3 +231,78 @@ explain: seed
|
||||
echo "\$$ make explain # scripts/sql/explain-history.sql"; \
|
||||
$(PSQL) -f - < scripts/sql/explain-history.sql; } > evidence/explain-history.txt
|
||||
cat evidence/explain-history.txt
|
||||
|
||||
images:
|
||||
$(PYTHON) scripts/make_images.py
|
||||
|
||||
queues:
|
||||
sh scripts/broker.sh queues
|
||||
|
||||
topology:
|
||||
{ echo "date: $$(date -u +%FT%TZ) commit: $$(git rev-parse --short HEAD)"; \
|
||||
echo "$$ rabbitmqctl list_queues -p messenger name type durable policy messages"; \
|
||||
$(COMPOSE) exec -T broker rabbitmqctl -q list_queues -p messenger name type durable policy messages; \
|
||||
echo "$$ rabbitmqctl list_consumers -p messenger"; \
|
||||
$(COMPOSE) exec -T broker rabbitmqctl -q list_consumers -p messenger queue_name ack_required prefetch_count; \
|
||||
echo "$$ rabbitmqctl list_permissions -p messenger"; \
|
||||
$(COMPOSE) exec -T broker rabbitmqctl -q list_permissions -p messenger; \
|
||||
echo "$$ rabbitmqctl list_users"; \
|
||||
$(COMPOSE) exec -T broker rabbitmqctl -q list_users; \
|
||||
echo "$$ docker compose ps"; \
|
||||
$(COMPOSE) ps --format '{{.Service}}\t{{.Status}}\t{{.Ports}}'; } > evidence/topology.txt
|
||||
cat evidence/topology.txt
|
||||
|
||||
worker-stop:
|
||||
sh scripts/worker.sh stop
|
||||
|
||||
worker-start:
|
||||
sh scripts/worker.sh start
|
||||
|
||||
broker-restart:
|
||||
sh scripts/broker.sh restart
|
||||
|
||||
suite-preflight:
|
||||
BASE_URL="$(BASE_URL)" $(PYTHON) scripts/pipeline_suite.py --preflight
|
||||
|
||||
level3:
|
||||
BASE_URL="$(BASE_URL)" $(PYTHON) scripts/pipeline_suite.py --level 3 --output evidence/level3.json
|
||||
|
||||
level4:
|
||||
BASE_URL="$(BASE_URL)" $(PYTHON) scripts/pipeline_suite.py --level 4 --output evidence/level4.json
|
||||
|
||||
failed:
|
||||
$(COMPOSE) run --rm --no-deps -T worker python -m messenger.admin failed
|
||||
|
||||
replay:
|
||||
@test -n "$(ID)" || (echo "Set ID=<attachment_id>"; exit 2)
|
||||
$(COMPOSE) run --rm --no-deps -T worker python -m messenger.admin replay --attachment-id "$(ID)"
|
||||
|
||||
dlq:
|
||||
sh scripts/broker.sh dlq
|
||||
|
||||
pipeline-evidence:
|
||||
$(PYTHON) scripts/pipeline_evidence.py --base-url "$(BASE_URL)" > evidence/pipeline-stand.txt; \
|
||||
status=$$?; cat evidence/pipeline-stand.txt; exit $$status
|
||||
|
||||
obs-validate:
|
||||
sh scripts/obs-validate.sh
|
||||
|
||||
telemetry-check:
|
||||
$(OBS_CHECK) grafana > evidence/grafana.json
|
||||
$(OBS_CHECK) dashboards --strict > evidence/dashboards.json
|
||||
$(OBS_CHECK) request --base-url "$(BASE_URL)" > evidence/trace-request.json
|
||||
$(OBS_CHECK) job --base-url "$(BASE_URL)" > evidence/trace-job.json
|
||||
$(OBS_CHECK) leaks --base-url "$(BASE_URL)" > evidence/leaks.json
|
||||
$(OBS_CHECK) query 'count by (__name__, job) ($(APP_METRICS))' \
|
||||
'count by (http_route, http_request_method) (http_server_request_duration_seconds_count)' \
|
||||
'count by (job_type, outcome) (messenger_jobs_processed_total)' > evidence/cardinality.json
|
||||
@echo "telemetry-check: evidence/grafana.json dashboards.json trace-request.json trace-job.json leaks.json cardinality.json"
|
||||
|
||||
.PHONY: track2 reprocess
|
||||
|
||||
track2:
|
||||
BASE_URL="$(BASE_URL)" $(PYTHON) scripts/pipeline_suite.py --level 5 --only "$(TRACK2_SCENARIOS)" --output "$(TRACK2_OUTPUT)"
|
||||
|
||||
reprocess:
|
||||
@test -n "$(ID)" || (echo "Set ID=<attachment_id>"; exit 2)
|
||||
$(COMPOSE) run --rm --no-deps -T worker python -m messenger.admin reprocess --attachment-id "$(ID)" --pipeline-version "$(PIPELINE_VERSION)"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Лабораторная 4. S3-хранилище и вложения
|
||||
# Лабораторная 6. Наблюдаемость: OpenTelemetry и Grafana
|
||||
|
||||
Разделить метаданные и бинарное содержимое, добавить изображения в сообщения и сохранить доступ к ним при переключении API-реплики.
|
||||
Научиться находить причину деградации через метрики, логи и трассы всей системы, включая фоновую обработку.
|
||||
|
||||
Это **skeleton**, а не готовый сервер. Здесь есть задание, контракт и публичные проверки. Реализацию приложения, Dockerfile и требуемую инфраструктуру пишет студент. Язык и framework свободные; UI не обязателен.
|
||||
|
||||
@@ -8,41 +8,41 @@
|
||||
|
||||
## Откуда начинаем
|
||||
|
||||
Перенесите минимум lab3. Дополняются поля сообщения и endpoint вложений; прежние текстовые POST остаются валидными.
|
||||
Перенесите минимум lab5. Бизнес-API не меняется. Должны оставаться API-реплики, БД, S3, broker и worker.
|
||||
|
||||
**Архитектура:** Клиент → LB → API × 2+ → PostgreSQL (метаданные) + приватное S3-хранилище (байты).
|
||||
**Архитектура:** API/worker → OTLP → OTel Collector → хранилища metrics/logs/traces → Grafana; queue context связывает API и worker.
|
||||
|
||||
## Что сделать
|
||||
|
||||
1. Выберите один S3-совместимый сервер: MinIO, SeaweedFS или RustFS. Закрепите проверенную версию образа и опишите создание приватного bucket.
|
||||
2. Спроектируйте Attachment и связь с чатом/сообщением. S3 object key назначает сервер, filename используется только для отображения.
|
||||
3. Реализуйте синхронный binary upload PNG/JPEG с ограничениями, сохранение метаданных и авторизованный download через API.
|
||||
4. Включите S3 и persistent volumes в общий Compose/Swarm. Проверьте, что другая API-реплика скачивает файл после остановки загрузившей.
|
||||
5. Проверьте недоступность S3, чужой чат и restart всего стенда.
|
||||
1. Выберите хранилища: например Prometheus для метрик, Loki для логов, Tempo для трасс. Разрешена другая совместимая комбинация с Grafana; Grafana сама не хранит все три сигнала.
|
||||
2. Добавьте SDK-инструментацию API и worker и отдельный Collector в общий Compose/Swarm; настройте receivers/processors/exporters и хранение данных.
|
||||
3. Реализуйте набор сигналов contracts/observability.md и импортируемые dashboard/datasources. Не используйте user_id/chat_id/message_id как labels метрик.
|
||||
4. Проверьте связь запроса, структурного лога и обработки задания. Секреты, тела сообщений и изображения не должны попадать в telemetry.
|
||||
5. Создайте нагрузку, внедрите два ограниченных отказа и найдите их причину только с помощью сохранённых наблюдений; приложите доказательства.
|
||||
|
||||
## Оценка «3»: работающий минимум
|
||||
|
||||
- Все обязательные возможности lab3 сохранены. S3-сервер находится в общем стенде; метаданные вложений живут в PostgreSQL, байты — в приватном bucket, не в БД или локальном каталоге API.
|
||||
- POST вложения возвращает 201 ready после сохранения; оригинал скачивается побайтно. Message с attachment_ids читается участниками чата. Публичный smoke проверяет checksum и отсутствие доступа у постороннего.
|
||||
- Принимаются реальные PNG/JPEG ≤10 MiB и ≤40 млн пикселей; MIME проверяется по содержимому, опасные filename отклоняются, лимиты применяются до неограниченного чтения/декодирования.
|
||||
- Upload → остановка обслужившей API-реплики → download через другую возвращает тот же файл. Restart с сохранением volumes сохраняет метаданные и оригинал.
|
||||
- Весь минимум lab5 работает. Collector, хранилища трёх сигналов и Grafana включены в общий воспроизводимый стенд; конфиги и provisioning лежат в Git, persistent volumes сохраняют нужную историю.
|
||||
- API и worker отдают OTLP в Collector. В Grafana видны: RPS/errors/duration API, успешные/ошибочные jobs и duration worker; доступны структурные логи и реальные трассы API и worker.
|
||||
- Есть импортируемый dashboard, а не только screenshot. Сохраняются низкокардинальные атрибуты и идентификаторы trace/span в логах; содержимое сообщений, пароли/токены не экспортируются.
|
||||
- На контролируемом запросе можно найти trace и связанный лог; на job — worker trace и лог. make test проходит при включённой телеметрии. Объяснено назначение каждого хранилища.
|
||||
|
||||
## Оценка «4»: уровень стажёра/джуна
|
||||
|
||||
Весь уровень 3 **и все** пункты ниже:
|
||||
|
||||
- Тесты покрывают слишком большой файл, повреждённое изображение, подмену MIME, чужое attachment_id и привязку файла другого чата. Пользовательская ошибка не превращается в 500.
|
||||
- Прерывание загрузки и отказ между записью S3/БД не оставляют вечных неучтённых объектов: есть документированный механизм компенсации/сверки/очистки с безопасным grace period.
|
||||
- Лимиты/таймауты и потоковая обработка не позволяют одной загрузке занять неограниченную RAM. Проведён эксперимент ≥10 одновременных загрузок с измерением пика памяти.
|
||||
- Bucket bootstrap идемпотентен; API использует отдельные S3 credentials с ограниченными правами. Административная консоль не открыта в общей сети. Есть проверка private bucket вне API.
|
||||
- W3C trace context переносится API → broker → worker; видны producer/consumer spans с корректной связью parent или link. По одному upload найдена цепочка до S3/DB результата, включая retry.
|
||||
- Dashboard показывает p50/p95/p99, долю ошибок, queue depth/возраст старейшей job, DB pool и saturation worker. Приведены запросы и единицы измерения; percentile вычисляется из histogram, не средних.
|
||||
- Задан проверяемый SLI/SLO и окно; сохранены alert rules минимум для высокого error rate и растущего queue lag. Alerts проверены искусственным отказом; доставка наружу не нужна, достаточно локального состояния firing/resolved.
|
||||
- Collector имеет memory limiter/batch и ограниченную буферизацию/поведение при недоступном backend. Остановка telemetry-хранилища не ломает сообщения и не вызывает бесконечный рост RAM. Отчёт содержит разбор двух инцидентов и шаги диагностики.
|
||||
|
||||
## Оценка «5»: исследование и доказанный результат
|
||||
|
||||
Весь уровень 4 **и один законченный трек на выбор**. Приведите гипотезу, повторяемую методику, результаты и ограничения.
|
||||
|
||||
**Трек 1. Прямой upload.** Добавьте отдельный безопасный presigned-upload flow: короткая подпись, уникальный ключ, проверка принадлежности, размера/checksum при complete, обработка незавершённой загрузки. Сохраните обязательный proxy endpoint. Сравните трафик и RAM API при ≥2 размерах файлов, покажите негативные сценарии.
|
||||
**Трек 1. Цена наблюдаемости.** Сравните telemetry off/on и ≥2 sampling/aggregation настройки при одинаковой нагрузке: latency, CPU/RAM, объём ingest, потери spans. Объясните, какие ошибки и редкие медленные запросы теряются; предложите и проверьте сбалансированную конфигурацию.
|
||||
|
||||
**Трек 2. Согласованность двух хранилищ.** Разработайте повторяемый reconciler для orphan/missing объектов и метаданных. Внедрите ошибки на обеих сторонах, покажите обнаружение и безопасное исправление с dry-run/повторным запуском. Докажите, что свежие и используемые вложения не удаляются; измерьте стоимость обхода.
|
||||
**Трек 2. SLO и обнаружение инцидентов.** Обоснуйте SLO для API и времени до ready, реализуйте burn-rate alerts с несколькими окнами, воспроизведите краткий всплеск и длительную деградацию. Измерьте время обнаружения/восстановления, ложные срабатывания и покажите runbook, по которому другой студент находит причину.
|
||||
|
||||
## Как начать и проверить
|
||||
|
||||
@@ -78,28 +78,28 @@ Smoke не выставляет оценку автоматически. Про
|
||||
|
||||
## Сценарий защиты
|
||||
|
||||
1. Загрузить fixture, отправить message с attachment_ids, скачать как второй участник и сравнить SHA-256.
|
||||
2. С третьим пользователем получить 404 для метаданных и bytes; direct unauthenticated S3 GET не отдаёт объект.
|
||||
3. Выполнить persistence и failover: общий тест начиная с lab4 сохраняет и повторно читает оригинал через API.
|
||||
4. Показать, что на API нет обязательного локального файла оригинала. Для 4/5 — отказы и эксперименты.
|
||||
1. С нуля поднять стенд, импортировать provisioning без ручного набора dashboard, запустить smoke и нагрузку.
|
||||
2. Показать свежие метрики, одну трассу и соответствующий структурный лог API и worker; проверить, что это данные своего приложения.
|
||||
3. Для 4: пройти от upload до worker в одном trace/связанных traces, остановить worker или ограничить DB, увидеть firing и затем resolved.
|
||||
4. Остановить telemetry backend, проверить сохранение работы API и ограниченное поведение exporter. Для 5: повторить эксперимент.
|
||||
|
||||
## Что должно быть в PR
|
||||
|
||||
Дополненный стенд, настройка bucket/политики, миграции Attachment, тесты файлов, описание согласованности БД/S3 и результаты.
|
||||
Collector configuration, конфиги backend, Grafana provisioning/dashboards, alert rules по уровню, схема сигналов и отчёт инцидентов.
|
||||
|
||||
Заполните `REPORT.md` и [шаблон PR](.github/pull_request_template.md), укажите целевую оценку/трек. Не меняйте обязательный контракт и публичные tests ради зелёного результата. Сохраняйте возможности предыдущих лабораторных в пределах [объявленных переходов](COURSE.md).
|
||||
|
||||
## Вопросы на защите
|
||||
|
||||
- Почему файл в Docker volume одной API-реплики не равен объектному хранилищу?
|
||||
- Когда можно честно вернуть 201?
|
||||
- Что произойдёт, если S3 PUT прошёл, а COMMIT в PostgreSQL — нет?
|
||||
- Почему случайный object key и приватный bucket не заменяют ACL приложения?
|
||||
- Чем лог, метрика и trace отвечают на разные вопросы об одном инциденте?
|
||||
- Почему chat_id в labels может исчерпать хранилище?
|
||||
- Как очередь переносит причинную связь между процессами?
|
||||
- Почему среднее latency не заменяет p99 и почему нельзя усреднять p99 реплик?
|
||||
|
||||
## Первичные материалы
|
||||
|
||||
- [S3 object uploads](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html)
|
||||
- [Presigned URLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html)
|
||||
- [MinIO](https://github.com/minio/minio)
|
||||
- [SeaweedFS](https://github.com/seaweedfs/seaweedfs)
|
||||
- [RustFS](https://docs.rustfs.com/)
|
||||
- [OTel Collector configuration](https://opentelemetry.io/docs/collector/configuration/)
|
||||
- [OTel propagation](https://opentelemetry.io/docs/concepts/context-propagation/)
|
||||
- [W3C Trace Context](https://www.w3.org/TR/trace-context/)
|
||||
- [Prometheus histograms](https://prometheus.io/docs/practices/histograms/)
|
||||
- [Grafana provisioning](https://grafana.com/docs/grafana/latest/administration/provisioning/)
|
||||
|
||||
@@ -1,450 +1,37 @@
|
||||
# Отчёт — лабораторная 4 «S3-хранилище и вложения»
|
||||
# Отчёт — лабораторная 6
|
||||
|
||||
Автор: **Костылев Артём, БПИ2303**. Ветка: `solution/bpi2303-kostylev`.
|
||||
Цель — **«5», трек 2 «Согласованность двух хранилищ (reconciler)»**.
|
||||
|
||||
Финальная validation завершена 2026-11-06 на
|
||||
`5e49502ae78fa48b992c97418e490666c699726d`: runtime совпадает с прошедшим независимое
|
||||
ревью `7a0ebac2aa9e1d8602054ca4c7c1b0c23d3bfad4`. Динамический долг обоих PNG-фиксов
|
||||
закрыт, открытых major не выявлено; известный minor сохранён в ограничениях.
|
||||
**Заявлена «5», трек 2**, с отрицательным результатом гипотезы о линейном времени.
|
||||
[Аудит применимости](evidence/load-validation.md) объясняет, какие старые серии приняты
|
||||
без повторения и какие проверки выполнены заново. Публикация ещё не разрешена.
|
||||
|
||||
## Происхождение и применимость доказательств
|
||||
|
||||
| Состояние кода | SHA | Что подтверждено и что сохраняется |
|
||||
| --- | --- | --- |
|
||||
| Перенос основы ЛР3 на SQLAlchemy/Alembic | `8e4532f6f5c05d902b6e2c310f54320d95585904`, источник `f591fa64e525679a31c9db7f942d36c789e1a12f` | Полная серия уровней 3/4; историческая относительно поздних исправлений |
|
||||
| Стоимость reconciler | `3402fd69d4922e500035a204d957be2cccaeb85a` | 27 пригодных замеров: измеряемый обход, SQL/S3-адаптеры, зависимости и стенд не менялись; сохраняются с исходным SHA |
|
||||
| Поздние исправления ЛР3 | `75b93bbba5f29575d3fca1d013cc7e0770d88082`, источник `ba78cf6da439a4ec60fd59389583b38285b0b2b1` | Сессии, NUL/Basic, JSON ошибок LB; 492 теста, 19 stack-тестов, отказы и новые серии. Все 214 путей диапазона учтены в [манифесте переноса](evidence/forward-port.md) |
|
||||
| Декодируемость PNG | `9387c3d82ab77ea376eecce19a36a22803d35efb` | Битый IDAT с корректными CRC отклоняется; [offline-доказательства](evidence/png-validation-fix/NOTES.md) |
|
||||
| Единый IHDR | `7c8a1a64899dc0a1b5fa0949c0992ef40722eacf`, архив/ревью `7a0ebac2aa9e1d8602054ca4c7c1b0c23d3bfad4` | Повторный IHDR отклоняется; 407 offline-тестов. [Манифест](evidence/png-header-fix/manifest.json) совпадает с текущими семью файлами |
|
||||
|
||||
После `75b93bb…` в runtime изменились только `images.py` и новый `png.py` зоны attachments.
|
||||
Поэтому старые upload-memory и загрузки во время сверки **не доказывают** память и скорость
|
||||
нового инспектора. Результаты текстового пути, скачивания, persistence/failover, IAM/bootstrap
|
||||
сохраняются для неизменённых механизмов; это не повторные прогоны на текущем HEAD.
|
||||
Серия asyncpg 29–30 октября вынесена из основных таблиц в
|
||||
[исторический индекс](evidence/README.md#историческая-реализация-asyncpg).
|
||||
|
||||
[Индекс evidence](evidence/README.md) связывает команды, SHA и файлы.
|
||||
[Аудит отчётного этапа](evidence/report-audit-2026-11-06.md) содержит проверки исходных чисел,
|
||||
ссылок и границ изменений. Сырые результаты не редактировались.
|
||||
- Автор, группа: TODO
|
||||
- Целевая оценка; выбранный трек 5, если нужен: TODO
|
||||
- Commit/PR: TODO после публикации
|
||||
- Использованные источники, библиотеки и помощь ИИ: TODO
|
||||
|
||||
## Запуск из чистого clone
|
||||
|
||||
Нужны Git, Docker Compose v2, make, uv и Python 3.14 для приложения/собственных тестов;
|
||||
публичным проверкам достаточно системного Python 3.9+. Из основного репозитория можно
|
||||
создать свежий clone под разрешённым каталогом `.verification/`:
|
||||
|
||||
```sh
|
||||
git clone --no-hardlinks --branch solution/bpi2303-kostylev . .verification/hlpipe-lab4-defense
|
||||
cd .verification/hlpipe-lab4-defense
|
||||
export COMPOSE_PROJECT_NAME=hlpipe-lab4-defense
|
||||
export COMPOSE_FILE=compose.yaml
|
||||
export LB_HTTP_PORT=18084 LB_STATS_PORT=24845
|
||||
export BASE_URL=http://127.0.0.1:18084
|
||||
export NO_PROXY=localhost,127.0.0.1,::1
|
||||
export no_proxy=localhost,127.0.0.1,::1
|
||||
make secrets
|
||||
docker compose --env-file .env config --quiet
|
||||
make up
|
||||
make test
|
||||
make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
docker compose ps -a
|
||||
make restore
|
||||
make scenario SCENARIO=failover-upload
|
||||
make restore
|
||||
make scenario SCENARIO=s3-outage
|
||||
make s3-check
|
||||
make reconcile
|
||||
make migrate
|
||||
make down
|
||||
```
|
||||
|
||||
Имя clone/project должно быть новым; порт 18084 должен быть свободен. Занявший его чужой
|
||||
стенд не останавливается. `make secrets` создаёт локальные файлы и не перезаписывает
|
||||
существующие; содержимое секретов выводить не нужно. `make up` ждёт PostgreSQL/Valkey/RustFS,
|
||||
`alembic upgrade head`, bootstrap bucket и обе API-реплики в ротации LB. Повторный `make migrate`
|
||||
не меняет актуальную схему. `make down` сохраняет постоянные volumes; `reset-data`, `down -v`
|
||||
и удаление пользовательских данных в этом процессе не используются.
|
||||
|
||||
Сохранённое воспроизведение из свежего clone: **76,866 с, exit 0**, SHA
|
||||
`cf41f7c64dcf1dea6da0643f5793bd2e5dd1f03e`, проект `hlpipe-lab4-clean-20261105231220`.
|
||||
Smoke, persistence, failover, upload→stop→download, S3-outage, 31 проверка S3, dry-run и
|
||||
повторная миграция прошли; после down остались три volumes.
|
||||
[Полная команда и вывод](evidence/sqlalchemy-2026-11-06/grade4/clean-clone-command.txt).
|
||||
Это запуск **до позднего переноса и PNG-фиксов**, а не доказательство запуска нынешнего SHA.
|
||||
|
||||
Проверки исходников выполняются отдельно:
|
||||
|
||||
```sh
|
||||
make install
|
||||
make check
|
||||
make validate
|
||||
make lint
|
||||
make student-test
|
||||
openspec validate --all --strict --no-interactive
|
||||
```
|
||||
|
||||
`make student-test` использует одноразовые Docker-зависимости. На отчётном этапе выполнены
|
||||
только check/validate/lint/OpenSpec и чтение сохранённых доказательств; тесты с Docker и
|
||||
нагрузки не запускались. Сохранённые полные 492 теста относятся к `75b93bb…`, а 407 unit-тестов
|
||||
после PNG-фиксов — к `7c8a1a6…`; складывать эти числа в число тестов одного прогона нельзя.
|
||||
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
|
||||
|
||||
## Архитектура и решения
|
||||
|
||||
```text
|
||||
клиент → HAProxy :18084 → API ×2, по 2 UvicornWorker
|
||||
├→ PostgreSQL: метаданные, сессии, сообщения
|
||||
├→ Valkey: кэш сессий
|
||||
└→ RustFS: байты оригиналов
|
||||
migrate → PostgreSQL; s3-init → private bucket и IAM
|
||||
reconciler → PostgreSQL + RustFS, одноразовый сервис
|
||||
```
|
||||
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab5, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
|
||||
|
||||
Python 3.14, FastAPI, gunicorn/uvicorn-worker, dishka, Pydantic v2, structlog,
|
||||
**SQLAlchemy 2.0.45 async, asyncpg как драйвер, Alembic 1.16.5**, aiobotocore и Pillow 13.0.0.
|
||||
Версии зависимостей закреплены в [uv.lock](uv.lock), правила форматирования — пробелы в
|
||||
[pyproject.toml](pyproject.toml). Образы закреплены digest в [compose.yaml](compose.yaml):
|
||||
HAProxy 3.2.26, PostgreSQL 17.11, Valkey 8.1.11, RustFS 1.0.4, rc 0.1.36.
|
||||
## Доказательства критериев
|
||||
|
||||
Зоны `identity`, `messaging`, `attachments` содержат домен, прикладные порты и адаптеры;
|
||||
`shared` — платформу, `main.py` — сборку. Межзонная проверка членства идёт через порт
|
||||
`ChatMembership`, не через импорт инфраструктуры соседней зоны. Pydantic остаётся на HTTP-границе,
|
||||
ORM-модели `DeclarativeBase` — внутри зон. Сессии создаёт `async_sessionmaker`; UoW получает
|
||||
свою `AsyncSession` на транзакцию и явно делает COMMIT. Незавершённая транзакция откатывается
|
||||
при закрытии сессии. SQL строится ORM/Core с параметрами; `asyncpg` не используется как
|
||||
отдельный прикладной слой запросов. Отправка сообщения — Core CTE под блокировкой строки чата:
|
||||
квитанция `Idempotency-Key`, сообщение и ссылки на вложения фиксируются вместе.
|
||||
|
||||
Alembic [env.py](alembic/env.py) использует async engine и `run_sync`, advisory lock и
|
||||
транзакции миграций. Ревизии: `0001` — базовая схема, `0002` — ключи идемпотентности,
|
||||
`0003` — вложения/связи, `0004` — карантин. Legacy-схема принимается только после сверки
|
||||
журнала и каталога в [legacy.py](alembic/legacy.py); произвольный stamp вместо миграции не применяется.
|
||||
При подготовке отчёта через Context7 сверены закреплённые версии:
|
||||
[SQLAlchemy, сессии](https://github.com/sqlalchemy/sqlalchemy/blob/rel_2_0_45/doc/build/orm/session_basics.rst),
|
||||
[Alembic, async migrations](https://github.com/sqlalchemy/alembic/blob/rel_1_16_5/docs/build/cookbook.rst).
|
||||
|
||||
**Источники истины.** PostgreSQL хранит владельца/чат, имя, MIME, размер, SHA-256, размеры
|
||||
изображения, статус, object key и ссылки сообщений. Байты — только в приватном RustFS,
|
||||
ключ `attachments/<uuid>` назначает сервер. API read-only, без data volumes; `/tmp` — tmpfs.
|
||||
`attachments.object_key` имеет UNIQUE и `COLLATE "C"`; частичный индекс pending обслуживает
|
||||
уборку; FK `message_attachments (attachment_id, chat_id)` не даёт привязать чужой чат или
|
||||
удалить используемое вложение. История использует keyset `(created_at, id)`.
|
||||
|
||||
**Upload.** Сначала аутентификация (`401`), объявленный размер (`413`), членство (`404`),
|
||||
filename (`400`), MIME (`415`). Поток ограничен 10 485 760 байтами и считается также без
|
||||
Content-Length; SHA-256 вычисляется при чтении. Тело собирается в ограниченный буфер под
|
||||
`UPLOAD_CONCURRENCY=3` на worker; две проверки изображений на worker работают в потоках.
|
||||
Лимит 40 млн пикселей проверяется до распаковки. PNG требует единственный первый IHDR,
|
||||
проверку CRC и потоковую проверку zlib/Adler-32, длины строк и фильтров, включая Adam7.
|
||||
Дополнительные блоки распаковки — по 64 KiB, полного массива пикселей нет. JPEG проверяется
|
||||
через `draft` 1/8 и `load`. Ошибка изображения → `415` до намерения в БД/S3.
|
||||
Оба PNG из ревью отклоняются с 415 в ASGI-регрессиях и через настоящий LB/RustFS.
|
||||
После двух запросов число строк/объектов осталось 7/7; корректные PNG/JPEG скачаны
|
||||
вторым участником побайтно: [финальная сверка](evidence/png-final-2026-11-06/png-roundtrip.json).
|
||||
|
||||
Порядок публикации: `INSERT pending + COMMIT → PUT → UPDATE ready + COMMIT → 201`.
|
||||
Метаданные и скачивание доступны только участникам чата; чужой и неизвестный id дают `404`.
|
||||
Скачивание идёт через API кусками 64 KiB, с исходными байтами и истинным MIME, без redirect.
|
||||
`attachment_ids` присутствует во всех ответах сообщений, отсутствие и `[]` дают один fingerprint.
|
||||
|
||||
**Компенсация.** После отказа фиксации ready новая транзакция блокирует строку `FOR UPDATE`:
|
||||
ready не трогается; у pending удаляется объект, затем строка. При отмене/неизвестном исходе
|
||||
PUT намерение остаётся для уборки. Sweeper раз в 30 с выбирает до 100 pending старше 900 с
|
||||
через `FOR UPDATE SKIP LOCKED`, удаляет объект раньше строки и публикует
|
||||
`audit.attachment_discarded`. Готовые и используемые вложения не выбираются.
|
||||
|
||||
**Ресурсы и отказы.** У API 1 CPU/512 MiB на реплику, у LB 1 CPU/128 MiB,
|
||||
PostgreSQL 2 CPU/1 GiB, RustFS 1 CPU/512 MiB, Valkey 0,5 CPU/128 MiB;
|
||||
reconciler 1 CPU/256 MiB. Условия cost-эксперимента отличаются и указаны отдельно.
|
||||
Слоты дополнены буферами HAProxy 64 KiB, максимумом TCP-буфера API 256 KiB и
|
||||
`MALLOC_MMAP_THRESHOLD_=131072`. S3 connect/read = 1/2 с, две попытки; запрос — 8 с,
|
||||
LB — 10 с простоя. Дедлайн продлевается переданными байтами при пороге 128 KiB/s,
|
||||
поэтому идущая передача может длиться дольше 8 с. LB не повторяет upload.
|
||||
Readiness проверяет PostgreSQL, но не S3: отказ хранилища изображений сохраняет текстовый путь.
|
||||
|
||||
**Доступ к S3.** Только LB публикует host-порты на loopback. RustFS в internal-сети,
|
||||
консоль выключена. `s3-init` повторяемо создаёт private bucket, политики/пользователей и
|
||||
lifecycle очистки незавершённых multipart. API получает только Get/Put/DeleteObject своего
|
||||
bucket, reconciler — отдельный ключ ListBucket/Get/DeleteObject; root-ключи есть лишь у
|
||||
`s3`, `s3-init`, `s3-cli`. `s3-init`/`s3-cli` — uid 65534, migrate/reconciler — `init: true`.
|
||||
|
||||
## Критерий → команда → наблюдение → файл
|
||||
|
||||
Номера ниже — строки этого отчёта, а не дополнительная рубрика. **F** означает SHA
|
||||
`75b93bbba5f29575d3fca1d013cc7e0770d88082` до PNG-фиксов; **S** — исходную SQLAlchemy-серию,
|
||||
точный SHA команды находится в её raw. **V** — финальная validation на
|
||||
`5e49502ae78fa48b992c97418e490666c699726d`, runtime идентичен прошедшему review `7a0ebac…`.
|
||||
[Новые команды и результаты](evidence/load-validation.md) дополняют сохранённые проверки.
|
||||
|
||||
| Критерий | Команда | Наблюдение и применимость | Файл |
|
||||
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
|
||||
| --- | --- | --- | --- |
|
||||
| 3.1 Минимум ЛР3 | `make test`; `student-tests/tools/forward_network.py`; `make lb-check`; `make retry-check` | F: smoke, отзыв сессий на двух репликах, NUL/Basic PASS; S: 20×8 запросов с одним ключом, одна копия; потерянный ответ и kill без дублей | [smoke](evidence/forward-final-2026-11-06/smoke.txt), [сеть](evidence/forward-final-2026-11-06/network-regressions.txt), [LB](evidence/sqlalchemy-2026-11-06/grade3/lb-check-rerun.txt), [retry](evidence/sqlalchemy-2026-11-06/grade3/retry.txt) |
|
||||
| 3.2 Метаданные отдельно от байтов, приватность, stateless API | `make attachments-evidence`; `make limits` | S: внешняя сверка размера/SHA, изображения не в БД/API; F: лимиты, сети, mounts и порты PASS | [размещение](evidence/sqlalchemy-2026-11-06/grade3/storage-layout.txt), [лимиты](evidence/forward-final-2026-11-06/limits.txt) |
|
||||
| 3.3 `201 ready`, сообщения, checksum, чужому `404` | `make test`; `make student-test` | F: PASS, включая реальные PostgreSQL/RustFS-тесты; V: smoke и 721 собственная проверка прошла (719 + адресный повтор 2 setup errors) | [smoke](evidence/forward-final-2026-11-06/smoke.txt), [492 теста](evidence/forward-final-2026-11-06/offline-checks-rerun.txt), [V smoke](evidence/png-final-2026-11-06/smoke.txt) |
|
||||
| 3.4 PNG/JPEG, 10 MiB/40 MP, MIME/filename | `make test-faults`; `make student-test PYTEST_ARGS='-q --tb=short student-tests/unit'` | F: граничные файлы, MIME/имена → 4xx; текущие offline-регрессии: оба PNG из ревью → 415, без записи. V: оба файла → 415 через LB, число строк/объектов неизменно; PNG/JPEG скачаны побайтно | [старый suite](evidence/forward-final-2026-11-06/stack-faults.txt), [407 unit](evidence/png-header-fix/unit.txt), [регрессии](evidence/png-header-fix/targeted.txt), [V PNG/JPEG](evidence/png-final-2026-11-06/png-roundtrip.json) |
|
||||
| 3.5 Upload → остановка принявшей реплики → download | `make scenario SCENARIO=failover-upload` | F: target exited, сосед running, SHA совпал, download через 2,762 с | [JSON](evidence/forward-final-2026-11-06/failover-upload.json) |
|
||||
| 3.6 Restart с volumes и failover | `make persistence-evidence`; `make test-failover ACTION_SCRIPT=scripts/stop-one.sh` | F: данные/сессия сохранены; 130 записей, 0 ошибок, первая запись через 2,883 с | [persistence](evidence/forward-final-2026-11-06/persistence-rerun.txt), [failover](evidence/forward-final-2026-11-06/failover-d4c8d53d7433.txt) |
|
||||
| Отказ S3 | `make scenario SCENARIO=s3-outage` | F: upload/download 503 за 4,990/5,329 с; текст 201, метаданные/readiness 200; после возврата checksum равен | [JSON](evidence/forward-final-2026-11-06/s3-outage.json) |
|
||||
| 4.1 Пользовательские ошибки файлов не дают 500 | `make test-faults`; PNG ASGI-регрессии | F: 112 ответов в журнале негативного suite, 0×5xx; битый zlib и повторный IHDR добавлены позднее. V: 7 stack PASS, включая оба PNG; 54 ответа негативного теста, 0×5xx | [stack](evidence/forward-final-2026-11-06/stack-faults.txt), [PNG](evidence/png-header-fix/NOTES.md), [V suite](evidence/png-final-2026-11-06/upload-faults.txt) |
|
||||
| 4.2 Компенсация, crash и безопасная уборка | `make test-faults`; `make overload-leftovers` | F: COMMIT fault → 503, строка/объект удалены; обе реплики убиты между PUT/COMMIT, свежие/ready сохранены. S: 30 pending убраны после реальных 900 с, 1669 ready/объектов совпали | [отказы](evidence/forward-final-2026-11-06/stack-faults.txt), [grace без сдвига времени](evidence/sqlalchemy-2026-11-06/grade4/overload-leftovers.txt) |
|
||||
| 4.3 Ограниченная RAM, ≥10 загрузок | `make upload-memory ARGS='--slots 3 --out <новая-серия>'` | S: 36 точек; F: 3 точки, максимум 456,2 MiB, OOM 0, 238×201/2×503. V: 18 точек, 840/840×201, API ≤440 MiB, LB ≤31,1 MiB, OOM 0; 10×40 MP RGBA16 → 201, API ≤270,8 MiB | [S](evidence/sqlalchemy-2026-11-06/grade4/NOTES.md), [F](evidence/forward-port.md#повтор-затронутых-измерений), [V RAM](evidence/png-final-2026-11-06/memory-summary.json) |
|
||||
| 4.4 Bootstrap/IAM/закрытая консоль/private вне API | `make s3-check` | S: 31 PASS, anonymous GET 403, API ListBucket запрещён, повтор bootstrap ×2 неизменен; конфигурация не менялась | [сырой вывод](evidence/sqlalchemy-2026-11-06/grade3/s3-security.txt) |
|
||||
| 5.1 Внедрение, dry-run/apply/повтор, защита свежих и ссылок | F: `make reconcile-demo`; V: `python3 evidence/png-final-2026-11-06/concurrent-reconcile.py` | F: 13 PASS; 18 исправлений, повтор 0, ссылки сохранены; алгоритм не менялся. V: 3341×201 при 67 проходах, lost_ready=0, независимый SHA-аудит PASS | [demo](evidence/forward-final-2026-11-06/reconcile-demo/demo.json), [V load](evidence/png-final-2026-11-06/concurrent-reconcile/under-load.json) |
|
||||
| 5.2 Стоимость обхода | `make reconcile-cost ARGS='--out <новая-серия>'` | 27 замеров на `3402fd6…`, 1k/10k/30k/100k; страницы и память подтверждены, линейное время отвергнуто | [методика](evidence/sqlalchemy-2026-11-06/track5/NOTES.md), [сырьё](evidence/sqlalchemy-2026-11-06/track5/measurements/cost/) |
|
||||
| Публичный smoke | make test | TODO | TODO |
|
||||
| Остальные пункты уровня 3 | TODO | TODO | TODO |
|
||||
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
|
||||
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
|
||||
|
||||
## Отказы: наблюдаемое время и потери
|
||||
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
|
||||
|
||||
Основная таблица — **F**, проект `hlpipe-lab4-forward-final-20261106`.
|
||||
Времена — отдельные наблюдения, не SLA. Потерями считаются подтверждённые клиенту данные;
|
||||
намеренно повреждённые байты в demo отдельно отмечены. Состояния контейнеров сохранены
|
||||
в JSON/inspect и выводе хуков; неизвестные длительности не заменены нулём.
|
||||
## Эксперименты и отказы
|
||||
|
||||
| Воздействие / команда | Реально затронутый контейнер или объект | Наблюдение, время | Потери / файл |
|
||||
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
|
||||
|
||||
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
|
||||
| --- | --- | --- | --- |
|
||||
| `scenario failover-upload` | API `d4c8d53d7433` exited; `da922ab2ea09` running | Хук 2,734 с; download через 2,762 с от старта | Байты совпали; [JSON](evidence/forward-final-2026-11-06/failover-upload.json) |
|
||||
| `test-failover` | API `d4c8d53d7433`, подтверждён exited | 130 успешных записей, 0 failed_attempts; первая через 2,883 с | Дубликатов/потерь не обнаружено; [inspect и тест](evidence/forward-final-2026-11-06/failover-d4c8d53d7433.txt) |
|
||||
| `persistence-evidence` | API ×2, LB `ea6930f64089`, PG `3f3a870d89c0`, Valkey `07ea16e2fcfe`, S3 `5921e788f03d`; StartedAt изменились | Вся команда 13,179 с; это не точный интервал недоступности | Однократное чтение после hook сохранило данные/сессию; [до/после](evidence/forward-final-2026-11-06/persistence-rerun.txt) |
|
||||
| `scenario s3-outage` | S3 `5921e788f03d` exited | 503: upload 4,990 с, download 5,329 с; healthy через 5,760 с после старта | Готовый файл сохранился; текст 201; [JSON](evidence/forward-final-2026-11-06/s3-outage.json) |
|
||||
| `make test-faults`, PostgreSQL stop | Сервис postgres своего project; отдельного inspect в suite нет | 503 за 0,002–0,015 с; готовность через 2,1 с после старта | Прежний токен работает, 40 регистраций через 2 реплики без рестарта API; [stack](evidence/forward-final-2026-11-06/stack-faults.txt) |
|
||||
| `make test-faults`, Valkey stop | Сервис valkey своего project; отдельного inspect в suite нет | Живой токен 200 за 0,005 с; неизвестный 401 за 0,003 с; logout 503, после старта 204 | Отзыв не потерян; время восстановления не измерено; [stack](evidence/forward-final-2026-11-06/stack-faults.txt) |
|
||||
| COMMIT fault после PUT | Триггер в синтетическом сценарии | 503; сразу строка отсутствует и HEAD 404; audit compensation | Готовые не затронуты; [stack](evidence/forward-final-2026-11-06/stack-faults.txt) |
|
||||
| SIGKILL между PUT/COMMIT | По очереди API `da922ab2ea09`, `d4c8d53d7433` | Клиент 502; pending + объект. После сдвига за grace удаление через 26,1/1,5 с | Свежий остаток сохранён; ready в сообщении скачан с тем же SHA; [stack](evidence/forward-final-2026-11-06/stack-faults.txt) |
|
||||
| Обрыв / зависание тела | 256 KiB из 5 MiB / 1 KiB | Обрыв: 400 в журнале, нет intent; stall: 503 через 8,02 с | Новых видимых вложений нет; [stack](evidence/forward-final-2026-11-06/stack-faults.txt) |
|
||||
| Реальное ожидание grace, серия S | 30 pending: 27 после перегрузки, 3 после S3-outage | Наблюдение 847,812 с уже существовавших остатков; возраст не меняли, grace 900 с | 30 audit abandoned, затем 1669 ready = 1669 объектов; [вывод](evidence/sqlalchemy-2026-11-06/grade4/overload-leftovers.txt) |
|
||||
| Reconciler demo, порча обеих сторон | 3 orphan, 9 ready с потерянными/изменёнными байтами, 6 pending | Apply: 18 действий; повтор 0; полный demo 256,6 с | 9 ready и 6 ссылок сохранены, байты сами не восстанавливаются; [demo](evidence/forward-final-2026-11-06/reconcile-demo/demo.json) |
|
||||
| SIGTERM / S3 outage сверки | Одноразовый reconciler; S3 paused / остановлен | SIGTERM: 0,1 с, exit 143, lock освобождён; S3 outage: exit 1 за 2,32 с | Состояние не изменилось при outage; [demo](evidence/forward-final-2026-11-06/reconcile-demo/demo.json) |
|
||||
| TODO | TODO | TODO | TODO |
|
||||
|
||||
`failover-upload.json` содержит `restored=false`: сценарий сам не возвращал target;
|
||||
[отдельный restore](evidence/forward-final-2026-11-06/restore.txt) возвращает обе реплики.
|
||||
В конце фазы F все три её project остановлены, шесть постоянных volumes сохранены:
|
||||
[shutdown-state](evidence/forward-final-2026-11-06/shutdown-state.txt).
|
||||
Отчётный этап Docker не использовал. Состояние финальной validation-фазы и сохранённые
|
||||
volumes зафиксированы отдельно в [аудите](evidence/load-validation.md).
|
||||
## Ограничения и следующие шаги
|
||||
|
||||
## Память и запись сообщений
|
||||
|
||||
**Память S, до позднего переноса и PNG-фиксов.** Два API по 1 CPU/512 MiB, два worker,
|
||||
LB 128 MiB, RustFS 1 CPU/512 MiB; 3/64 слота × PNG около 1/10 MiB × 10/20/40 клиентов,
|
||||
три повтора каждой точки. Клиент с macOS, keep-alive, по два upload; перед точкой API/LB
|
||||
пересоздаются для нового cgroup `memory.peak`. Пик включает процессы, page cache и сокеты;
|
||||
p95 учитывает только 201. На сохранённом снимке фона — только свой project.
|
||||
[Методика и 36 raw-точек](evidence/sqlalchemy-2026-11-06/grade4/NOTES.md).
|
||||
|
||||
| Конфигурация | Ответы в 18 точках | Максимум API | OOM API/LB |
|
||||
| --- | --- | ---: | ---: |
|
||||
| 3 слота | 840/840 ×201 | 448,0 MiB | 0 |
|
||||
| 64 слота, исторический контроль | 813×201, 27×503 | 513,7 MiB | 0 |
|
||||
|
||||
**Память F, тоже до PNG-фиксов.** 40 клиентов, по два PNG 10 485 256 байт, 3 слота;
|
||||
три повтора дали 80/80/78 успешных ответов и 0/0/2 ответа 503. Пики API:
|
||||
456,2/438,1/450,4 MiB, LB: 31,8/28,5/29,1 MiB, OOM 0; p95 3641,3/4755,0/8091,8 мс.
|
||||
Причина двух 503 отдельно не локализована; уборка их возможных остатков в этой серии не
|
||||
измерялась. [Команды, фон и сырьё](evidence/forward-port.md#повтор-затронутых-измерений).
|
||||
Контроль 64/3 остаётся историческим; новый инспектор измерен отдельно в серии V ниже.
|
||||
|
||||
**Память V, после обоих PNG-фиксов.** На том же распределении ресурсов проведены
|
||||
ровно три новые серии штатных 3 слотов: ~1/10 MiB × 10/20/40 клиентов, два upload на
|
||||
клиента. Всего **18 точек, 840/840×201**, ошибок/таймаутов/OOM-kill нет.
|
||||
Максимум API **440,0 MiB / 512 MiB**, LB **31,1 MiB / 128 MiB**.
|
||||
[Команды, сырьё и фон](evidence/load-validation.md#новая-матрица-памяти),
|
||||
[пересчёт](evidence/png-final-2026-11-06/memory-summary.json).
|
||||
|
||||
| PNG / клиенты | Максимум API из 3 повторов, MiB | p95 успешных: медиана [min–max], мс |
|
||||
| --- | ---: | ---: |
|
||||
| ~1 MiB / 10 | 279,8 | 241,0 [134,3–257,7] |
|
||||
| ~1 MiB / 20 | 284,5 | 243,8 [226,6–310,2] |
|
||||
| ~1 MiB / 40 | 290,4 | 373,4 [367,6–417,6] |
|
||||
| ~10 MiB / 10 | 394,8 | 1520,3 [1236,1–3287,8] |
|
||||
| ~10 MiB / 20 | 440,0 | 2632,8 [2514,0–3632,6] |
|
||||
| ~10 MiB / 40 | 439,2 | 5971,4 [4256,0–6534,9] |
|
||||
|
||||
Дополнительный PNG 8000×5000 RGBA16: 311 100 байт на проводе, 320 005 000 байт
|
||||
распакованных строк. Перед нагрузкой файл независимо декодирован Pillow. 10 клиентов
|
||||
стартовали через barrier: **10×201**, 10 побайтных скачиваний вторым участником,
|
||||
API ≤270,828 MiB, LB ≤24,2 MiB, OOM 0. [Драйвер и raw](evidence/png-final-2026-11-06/high-depth.json).
|
||||
Это один сильно сжатый паттерн; он не представляет все PNG и не является SLO.
|
||||
|
||||
После нагрузок shallow-проверка: 859 ready = 859 объектов, ни pending, ни orphan,
|
||||
ни missing/size mismatch. SHA всех крупных объектов повторно не вычислялся.
|
||||
[Сверка](evidence/png-final-2026-11-06/post-memory-invariants.json). На снимках фона —
|
||||
только свой project; macOS, частоты, диск и кэш физического хоста не контролировались.
|
||||
|
||||
**Запись сообщений F.** `make load-evidence`: публичный `tests/load.py`, закрытый контур,
|
||||
64 клиента, 8 с, новый горячий чат на прогон, три повтора с паузой 15 с. Клиент-контейнер
|
||||
в edge-сети, 2 CPU/512 MiB; API ×2 по 1 CPU/512 MiB. На снимках до/после — только свой
|
||||
project, host load average 3,42→4,69. Физический хост не был выделен эксклюзивно.
|
||||
|
||||
| Повтор | RPS | p95 успешных, мс | Ошибок |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| 1 | 1428,577 | 100,062 | 0 |
|
||||
| 2 | 1456,338 | 98,948 | 0 |
|
||||
| 3 | 1529,320 | 98,475 | 0 |
|
||||
|
||||
Медиана **1456,338 RPS**, ошибок 0. [Команда](evidence/forward-final-2026-11-06/load-command.txt),
|
||||
[сырые JSON](evidence/forward-final-2026-11-06/load/), [фон](evidence/forward-final-2026-11-06/performance-before.txt).
|
||||
Это характеристика данного распределения ресурсов и одного чата, не SLO или предел архитектуры.
|
||||
Относительно ранней SQLAlchemy-серии 1529,186 RPS разница −4,8%; причинное влияние
|
||||
исправления из непарных серий не следует. PNG-изменения не вызываются текстовым запросом.
|
||||
|
||||
## Трек 2: согласованность двух хранилищ
|
||||
|
||||
`make reconcile` запускает `python -m messenger.attachments.entrypoints.reconcile`,
|
||||
по умолчанию dry-run; `ARGS='--apply --deep'` включает исправления и хеширование.
|
||||
Один проход сливает листинг S3 и keyset-страницы по `object_key` с индексом UNIQUE/COLLATE C.
|
||||
Алгоритм делает O(N) сравнений и хранит O(страница); это не обещание линейного времени RustFS.
|
||||
По умолчанию страница 1000, grace 3600 с + skew 60 с. Advisory lock разрешает один проход;
|
||||
второй возвращает skipped. Deep хеширует потоками 64 KiB, по умолчанию до восьми объектов.
|
||||
|
||||
| Расхождение | Безопасное действие `--apply` |
|
||||
| --- | --- |
|
||||
| Старый orphan | Повторная проверка строки по ключу, затем удаление объекта; свежий не трогается |
|
||||
| Старый pending | Повторная проверка под `FOR UPDATE SKIP LOCKED`, объект раньше строки, audit reason=reconcile |
|
||||
| Ready без объекта / другой размер / SHA | Повторная проверка; карантин, без удаления ready и ссылок сообщений; `/content` → 404 |
|
||||
| Объект карантина восстановлен | Снять карантин только после совпадения SHA-256, даже без `--deep` |
|
||||
|
||||
**Гипотезы до замеров** — [design на этапе SQLAlchemy](openspec/changes/archive/2026-11-06-verify-lab4-reconciler-sqlalchemy/design.md),
|
||||
proposal `751aaed4b1baaa957c74bb8874adeb0eac4b0480`:
|
||||
H1 — точное обнаружение/исправление, повтор 0 и сохранность свежих/используемых;
|
||||
H2 — shallow t(100k)/t(10k) в [7,13], страницы ceil(N/page), RSS растёт менее чем на 10%,
|
||||
deep на порядок дороже; H3 — после SQLAlchemy сохраняются страничность и ограниченная память.
|
||||
Отрицательный результат H2 не меняет исходную гипотезу.
|
||||
|
||||
**Корректность F.** На свежем отдельном project, grace 60/skew 0 внедрены ошибки обеих сторон.
|
||||
Dry-run не изменил 24 объекта/27 строк. Apply удалил 3 старых orphan и 6 pending, перевёл
|
||||
9 ready в карантин; шесть audit-событий, все шесть ссылок сохранены. Повтор — 0 действий.
|
||||
Возврат исходных байтов снял один карантин без deep, подмена той же длины — не сняла.
|
||||
Всего 13 PASS; [первичный demo](evidence/forward-final-2026-11-06/reconcile-demo/demo.json).
|
||||
При 75 с параллельных upload: 3364×201, 59 проходов, lost_ready=0, независимая проверка SHA
|
||||
в [check-under-load](evidence/forward-final-2026-11-06/reconcile-demo/check-under-load.json).
|
||||
**Конкурентная загрузка V после PNG-фиксов:** отдельный fresh project, 75 с / 3 потока,
|
||||
3341/3341×201, 67 проходов, errors=0/skipped=0, lost_ready=0. Независимый deep-аудит
|
||||
проверил SHA всех 3341 ready; каждый десятый upload привязан к сообщению. Удалены только
|
||||
3 внедрённых orphan. [Команда](evidence/png-final-2026-11-06/concurrent-reconcile.txt),
|
||||
[raw](evidence/png-final-2026-11-06/concurrent-reconcile/under-load.json),
|
||||
[SHA-аудит](evidence/png-final-2026-11-06/concurrent-reconcile/check-under-load.json).
|
||||
На пустом dataset инъекция pending создала 0 строк (ей нужна существующая строка-владелец);
|
||||
этот сценарий повторно не доказан серией V и сохраняется из полного demo F.
|
||||
Затронутый PNG-путь и сохранность всех 201 проверены; остальной алгоритм не менялся.
|
||||
Повторную проверку строки перед удалением дополнительно покрывает
|
||||
`test_row_written_after_listing_keeps_the_object`: наблюдение fresh не подменяет этот барьер.
|
||||
|
||||
**Стоимость на `3402fd69d4922e500035a204d957be2cccaeb85a`.** Свежий project
|
||||
`hlpipe-lab4-cost-20261106`; 1k/10k/30k/100k объектов и столько же ready-строк, PNG 8×8 по 264 B
|
||||
и один smoke-объект 111 817 B. Наполнение — четыре параллельных PUT и SQLAlchemy batch INSERT;
|
||||
измерение начинается после COMMIT и тихого окна, время наполнения исключено.
|
||||
API/LB/Valkey остановлены. RustFS 2 CPU/3 GiB, cpuset 11–12; PG 2 CPU/1 GiB, 13–14;
|
||||
CLI 1 CPU/256 MiB, 15. Это отдельная конфигурация, не штатные лимиты API-стенда.
|
||||
|
||||
Перед каждым повтором фильтр чужого CPU: ≤2 ядра VM и ≤0,25 на закреплённых,
|
||||
запас запуска 1,5/0,5 ядро·с; quiet 15 с, deadline 900 с, до трёх повторов отклонённой точки.
|
||||
Приняты 27, отклонённых 0; максимум чужого CPU 0,25 ядра, pinned 0. По три shallow/deep
|
||||
на каждом N и три page100 на 10k. Все raw с исходным SHA сохранены и пересчитаны при отчёте.
|
||||
[Команда](evidence/sqlalchemy-2026-11-06/track5/cost-command.txt),
|
||||
[полный протокол](evidence/sqlalchemy-2026-11-06/track5/NOTES.md),
|
||||
[план/фон/сырьё](evidence/sqlalchemy-2026-11-06/track5/measurements/cost/).
|
||||
|
||||
| N | Режим | Медиана прохода [min–max], с | LIST / SQL-страниц / GET | RSS, MiB, медиана |
|
||||
| ---: | --- | --- | --- | ---: |
|
||||
| 1000 | shallow | 0,107 [0,105–0,113] | 1 / 1 / 0 | 109,8 |
|
||||
| 1000 | deep | 0,499 [0,498–0,536] | 1 / 1 / 1000 | 110,2 |
|
||||
| 10000 | shallow | 0,999 [0,996–1,077] | 10 / 10 / 0 | 110,9 |
|
||||
| 10000 | deep | 4,998 [4,972–5,041] | 10 / 10 / 10000 | 111,3 |
|
||||
| 10000 | page100 | 2,037 [2,035–2,113] | 100 / 100 / 0 | 107,9 |
|
||||
| 30000 | shallow | 3,601 [3,567–3,633] | 30 / 30 / 0 | 110,9 |
|
||||
| 30000 | deep | 15,665 [15,630–15,779] | 30 / 30 / 30000 | 111,6 |
|
||||
| 100000 | shallow | 20,215 [20,206–21,335] | 100 / 100 / 0 | 111,1 |
|
||||
| 100000 | deep | 110,910 [58,661–147,215] | 100 / 100 / 100000 | 111,4 |
|
||||
|
||||
SQL здесь считает запросы страниц, без служебных BEGIN/COMMIT/pre-ping/advisory lock;
|
||||
HEAD/DELETE=0 во всех точках. `cost.seconds` — сам проход, CPU/wall в raw включают старт CLI.
|
||||
**H2 о времени отвергнута:** t100k/t10k=20,235. На 100k листинг занимает медиану 19,538 с;
|
||||
внутренняя причина его удорожания не установлена. Deep дороже в 4,35–5,49 раза, не на порядок.
|
||||
Страницы точно ceil(N/page), shallow RSS 109,8→111,1 MiB (+1,18%): эти части H2 и H3
|
||||
подтверждены в измеренной области. H1 подтверждена перечисленными сценариями на F.
|
||||
|
||||
Deep 100k: 147,215/110,910/58,661 с, разброс 79,84% медианы. Все повторы прошли заранее
|
||||
заданный фильтр; лучший не выбран вместо остальных. Один хост/VM, тёплые данные, частоты,
|
||||
диск и нагрузка macOS не контролировались. PNG 264 B не прогнозируют deep для 10 MiB,
|
||||
выше 100k измерений нет. Сравнение с историческим asyncpg — не причинный A/B-эксперимент.
|
||||
Сверка не восстанавливает утраченные байты и требует отдельного ручного/планового запуска.
|
||||
|
||||
## Завершение финальной validation
|
||||
|
||||
[Общий долг двух PNG-фиксов](evidence/png-header-fix/NOTES.md#обязательные-проверки-финального-этапа)
|
||||
закрыт на V: API-тесты с PostgreSQL, upload faults через LB/RustFS, 18 точек штатной
|
||||
матрицы RAM, десять одновременных 40 MP RGBA16 и upload при сверке с независимым SHA-аудитом.
|
||||
Команды и сырые результаты — в [аудите](evidence/load-validation.md).
|
||||
|
||||
`make student-test` дал 719 PASS и 2 setup errors из-за неготового временного RustFS;
|
||||
адресный повтор только этих двух тестов прошёл. Таким образом, все 721 выбранная
|
||||
проверка исполнена успешно, первый полный запуск не объявляется зелёным. Отдельно
|
||||
7 stack-тестов PASS. `make check`, `make validate`, `make lint` и OpenSpec strict (18)
|
||||
прошли. Реализация, конфиги, нормативные файлы и OpenSpec не менялись.
|
||||
|
||||
Принятые 27 cost-замеров и 3 повтора текстовой нагрузки сохранены с исходными SHA: повтор
|
||||
не требовался. Старые 64/3 и upload-memory до PNG-фиксов не используются для вывода о
|
||||
новом инспекторе. После Docker-этапа оба собственных project остановлены, шесть постоянных
|
||||
volumes сохранены; [инвентаризация](evidence/png-final-2026-11-06/shutdown-state.txt).
|
||||
Публикация — только после отдельной команды координатора PUBLICATION; push не выполнялся.
|
||||
|
||||
## Ограничения
|
||||
|
||||
- **Minor, сохранён ревью:** непарные Unicode-суррогаты U+D800/U+DFFF в `text` вызывают
|
||||
`PydanticSerializationError` в `fingerprint()` и HTTP 500. Файл
|
||||
[schemas.py:35](src/messenger/messaging/entrypoints/schemas.py#L35),
|
||||
[HTTP-доказательство](evidence/forward-final-2026-11-06/known-minor-http.txt).
|
||||
Это дефект, не PASS; по правилу пользователя minor не требует fix и не блокирует этап.
|
||||
- Один Docker-host, по одному PostgreSQL/RustFS/LB — точки отказа; репликация и резервные
|
||||
копии байтов здесь не исследуются. При остановке всех API sweeper ждёт их возврата.
|
||||
- Тело upload ограничено, но хранится целиком; слоты защищают память ценой очереди.
|
||||
Два 503 в F сохранены без объяснения недоказанной причиной. В V все 840 запросов
|
||||
успешны при пике ≤440 MiB; это измеренная область 10–40 клиентов, не общий предел RAM
|
||||
и не обещание 100% успеха при любой нагрузке.
|
||||
- При неизвестном результате PUT/COMMIT остаток ждёт grace; потерянный ответ upload
|
||||
допускает повторное вложение, поскольку у этого endpoint нет Idempotency-Key.
|
||||
- После отправки заголовков сбой S3 при download может оборвать поток; слишком медленная
|
||||
передача и SIGTERM также ограничены таймаутами. Ранний отказ во время отправки большого
|
||||
тела клиент иногда увидит как reset. Сессия проверяется раньше объявленного размера.
|
||||
- В demo grace 60/skew 0, смещение часов не моделировалось; реальный grace API 900 с
|
||||
отдельно подтверждён старой серией S. Reconciler не восстанавливает повреждённые байты.
|
||||
- Нагрузка записи — закрытый контур и один чат, успешные latency имеют coordinated omission.
|
||||
Причинный эффект SQLAlchemy/исправлений и предел системы из этих чисел не выводятся.
|
||||
- Секреты — локальные файлы Compose вместо менеджера секретов; статические S3-ключи без
|
||||
исследованной ротации. TLS, presigned flow, брокер и варианты изображений вне этой лабы.
|
||||
- Исторические proposal `add-lab4-image-attachments` и `add-lab4-upload-resilience`
|
||||
превышают рекомендацию 400 слов; история не переписана. `openspec/config.yaml` сверён
|
||||
с текущим стеком, но в документационном этапе не редактировался по ограничению области работ.
|
||||
|
||||
## Ответы на вопросы защиты
|
||||
|
||||
**Почему volume одной API-реплики не равен объектному хранилищу?** Другая реплика не обязана
|
||||
видеть её локальный volume. RustFS даёт всем репликам одно адресуемое ключами хранилище
|
||||
с политиками доступа; остановка принявшей API не удаляет оригинал. В F это показали
|
||||
разные `X-Instance-Id` и совпавший SHA-256 после остановки target.
|
||||
|
||||
**Когда можно вернуть 201?** После успешного PUT и COMMIT статуса ready. Pending уже
|
||||
зафиксирован до PUT, но не виден пользователям. Потерянный ответ после COMMIT возможен;
|
||||
это не позволяет заранее отвечать 201.
|
||||
|
||||
**Что если S3 PUT прошёл, а COMMIT — нет?** При известном отказе компенсация под блокировкой
|
||||
удаляет объект, затем pending. При падении процесса/неизвестном исходе это делает sweeper
|
||||
после grace. Уже ready не удаляется; независимые orphan и расхождения ищет reconciler.
|
||||
|
||||
**Почему случайный key/private bucket не заменяют ACL?** S3-ключ API разрешает доступ
|
||||
ко всему bucket и не знает членства пользователей в чатах. Поэтому каждый запрос
|
||||
метаданных/байтов проверяет членство; постороннему 404. Private bucket дополнительно
|
||||
закрывает прямой анонимный GET, но не принимает решение за приложение.
|
||||
|
||||
Для защиты: `make test` показывает upload→message→download и чужому 404;
|
||||
`make s3-check` — private вне API; persistence/failover — сохранность;
|
||||
`make attachments-evidence` — отсутствие локальных файлов API; сценарии уровней 4/5 —
|
||||
компенсацию, ограничения памяти и безопасную сверку. Следует показать исходный SHA каждого
|
||||
результата и новые доказательства PNG-инспектора из серии V.
|
||||
|
||||
Решение перенесено из собственной ЛР3. При реализации и подготовке отчёта использован Codex;
|
||||
автор работы — Костылев Артём. Нормативные README/COURSE/contracts/tests сохранены.
|
||||
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
|
||||
|
||||
+11
-1
@@ -6,7 +6,13 @@ from legacy import adopt_legacy
|
||||
from sqlalchemy import Connection, func, make_url, pool, select
|
||||
from sqlalchemy.ext.asyncio import create_async_engine
|
||||
|
||||
from messenger.attachments.infrastructure.postgres import AttachmentRow
|
||||
from messenger.attachments.infrastructure.postgres import (
|
||||
AttachmentRow,
|
||||
JobEventRow,
|
||||
JobRow,
|
||||
OutboxRow,
|
||||
VariantRow,
|
||||
)
|
||||
from messenger.identity.infrastructure.postgres import SessionRow, UserRow
|
||||
from messenger.messaging.infrastructure.postgres import (
|
||||
ChatMemberRow,
|
||||
@@ -26,6 +32,10 @@ MODELS = (
|
||||
MessageRow,
|
||||
IdempotencyKeyRow,
|
||||
AttachmentRow,
|
||||
JobRow,
|
||||
OutboxRow,
|
||||
JobEventRow,
|
||||
VariantRow,
|
||||
MessageAttachmentRow,
|
||||
)
|
||||
target_metadata = UserRow.metadata
|
||||
|
||||
+3
-1
@@ -10,7 +10,9 @@ LEGACY = {
|
||||
"0001_init": "9a13618f078ae9056431391e2e5197a31b981ae1fff047a9b3421ac750d3fd0d",
|
||||
"0002_idempotency_keys": "d9159a35553249a1e51af5f2e4e7c39b014e97593c49748e13f3799839063dd0",
|
||||
"0003_attachments": "c4417f560538a083efba1c67f660147dc94532fcbb2fa91f3f3e8258a0f01f2e",
|
||||
"0004_attachment_quarantine": (
|
||||
"0004_jobs": "c3887fa7a886ae8153a216aa43fd4c3c6190a2074e8ce20c3e77f29bfb01550e",
|
||||
"0005_failed_registry": "02b80061a08a6929feb092148c453ad970e3d001901c651b5a73b90b1e40f145",
|
||||
"0006_attachment_quarantine": (
|
||||
"541f5399d87fac3584c4102b4e0bf92c23cd372cc20a7d56dad03e771773202c"
|
||||
),
|
||||
}
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
revision = "0004_jobs"
|
||||
down_revision = "0003_attachments"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.drop_constraint("attachments_status_check", "attachments", type_="check")
|
||||
op.create_check_constraint(
|
||||
"attachments_status_check",
|
||||
"attachments",
|
||||
"status IN ('pending', 'queued', 'processing', 'ready', 'failed')",
|
||||
)
|
||||
for name in ("staging_key", "original_key"):
|
||||
op.add_column("attachments", sa.Column(name, sa.Text(collation="C"), nullable=True))
|
||||
op.create_unique_constraint(f"attachments_{name}_key", "attachments", [name])
|
||||
op.add_column(
|
||||
"attachments",
|
||||
sa.Column("published_version", sa.Integer(), nullable=False, server_default="0"),
|
||||
)
|
||||
op.create_check_constraint(
|
||||
"attachments_published_version_check", "attachments", "published_version >= 0"
|
||||
)
|
||||
op.add_column("attachments", sa.Column("error_code", sa.Text(), nullable=True))
|
||||
op.create_check_constraint(
|
||||
"attachments_error_code_check",
|
||||
"attachments",
|
||||
"error_code IN ('invalid_image', 'processing_failed', 'retry_exhausted')",
|
||||
)
|
||||
op.alter_column("attachments", "object_key", nullable=True)
|
||||
attachments = sa.table(
|
||||
"attachments",
|
||||
sa.column("status"),
|
||||
sa.column("object_key"),
|
||||
sa.column("original_key"),
|
||||
sa.column("staging_key"),
|
||||
sa.column("published_version"),
|
||||
)
|
||||
op.execute(
|
||||
attachments.update()
|
||||
.where(attachments.c.status == "ready")
|
||||
.values(original_key=attachments.c.object_key, published_version=1)
|
||||
)
|
||||
op.execute(
|
||||
attachments.update()
|
||||
.where(attachments.c.status == "pending")
|
||||
.values(staging_key=attachments.c.object_key)
|
||||
)
|
||||
op.create_index(
|
||||
"attachments_staged_idx",
|
||||
"attachments",
|
||||
["updated_at"],
|
||||
postgresql_where=sa.column("staging_key").is_not(None),
|
||||
)
|
||||
op.create_table(
|
||||
"attachment_variants",
|
||||
sa.Column("attachment_id", sa.Uuid(), sa.ForeignKey("attachments.id"), nullable=False),
|
||||
sa.Column("pipeline_version", sa.Integer(), nullable=False),
|
||||
sa.Column("name", sa.Text(), nullable=False),
|
||||
sa.Column("object_key", sa.Text(collation="C"), nullable=False),
|
||||
sa.Column("content_type", sa.Text(), nullable=False),
|
||||
sa.Column("size_bytes", sa.BigInteger(), nullable=False),
|
||||
sa.Column("width", sa.Integer(), nullable=False),
|
||||
sa.Column("height", sa.Integer(), nullable=False),
|
||||
sa.Column("sha256", sa.Text(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.PrimaryKeyConstraint("attachment_id", "pipeline_version", "name"),
|
||||
sa.UniqueConstraint("object_key", name="attachment_variants_object_key_key"),
|
||||
sa.CheckConstraint(
|
||||
"pipeline_version >= 1", name="attachment_variants_pipeline_version_check"
|
||||
),
|
||||
sa.CheckConstraint(
|
||||
"name IN ('thumbnail', 'crop', 'optimized')", name="attachment_variants_name_check"
|
||||
),
|
||||
sa.CheckConstraint(
|
||||
"content_type IN ('image/jpeg', 'image/png', 'image/webp')",
|
||||
name="attachment_variants_content_type_check",
|
||||
),
|
||||
sa.CheckConstraint("size_bytes >= 1", name="attachment_variants_size_bytes_check"),
|
||||
sa.CheckConstraint("width >= 1", name="attachment_variants_width_check"),
|
||||
sa.CheckConstraint("height >= 1", name="attachment_variants_height_check"),
|
||||
sa.CheckConstraint("sha256 ~ '^[0-9a-f]{64}$'", name="attachment_variants_sha256_check"),
|
||||
)
|
||||
op.create_table(
|
||||
"jobs",
|
||||
sa.Column("job_id", sa.Uuid(), primary_key=True),
|
||||
sa.Column("attachment_id", sa.Uuid(), sa.ForeignKey("attachments.id"), nullable=False),
|
||||
sa.Column("pipeline_version", sa.Integer(), nullable=False),
|
||||
sa.Column("status", sa.Text(), nullable=False),
|
||||
sa.Column("attempt", sa.Integer(), nullable=False),
|
||||
sa.Column("claims", sa.Integer(), nullable=False, server_default="0"),
|
||||
sa.Column("lease_token", sa.Uuid(), nullable=True),
|
||||
sa.Column("lease_until", sa.DateTime(timezone=True), nullable=True),
|
||||
sa.Column("next_attempt_at", sa.DateTime(timezone=True), nullable=True),
|
||||
sa.Column("last_error", sa.Text(), nullable=True),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.UniqueConstraint("attachment_id", "pipeline_version", name="jobs_effect_key"),
|
||||
sa.CheckConstraint("pipeline_version >= 1", name="jobs_pipeline_version_check"),
|
||||
sa.CheckConstraint(
|
||||
"status IN ('queued', 'processing', 'done', 'failed', 'superseded')",
|
||||
name="jobs_status_check",
|
||||
),
|
||||
sa.CheckConstraint("attempt >= 1", name="jobs_attempt_check"),
|
||||
sa.CheckConstraint("claims >= 0", name="jobs_claims_check"),
|
||||
)
|
||||
op.create_index(
|
||||
"jobs_lease_idx",
|
||||
"jobs",
|
||||
["lease_until"],
|
||||
postgresql_where=sa.column("status") == "processing",
|
||||
)
|
||||
op.create_table(
|
||||
"outbox",
|
||||
sa.Column("id", sa.BigInteger(), sa.Identity(always=True), primary_key=True),
|
||||
sa.Column("job_id", sa.Uuid(), sa.ForeignKey("jobs.job_id"), nullable=False),
|
||||
sa.Column("payload", postgresql.JSONB(), nullable=False),
|
||||
sa.Column("available_at", sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column("published_at", sa.DateTime(timezone=True), nullable=True),
|
||||
)
|
||||
op.create_index(
|
||||
"outbox_pending_idx",
|
||||
"outbox",
|
||||
["available_at", "id"],
|
||||
postgresql_where=sa.column("published_at").is_(None),
|
||||
)
|
||||
op.create_index("outbox_job_idx", "outbox", ["job_id"])
|
||||
op.create_table(
|
||||
"job_events",
|
||||
sa.Column("id", sa.BigInteger(), sa.Identity(always=True), primary_key=True),
|
||||
sa.Column("job_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("attachment_id", sa.Uuid(), nullable=False),
|
||||
sa.Column("kind", sa.Text(), nullable=False),
|
||||
sa.Column("attempt", sa.Integer(), nullable=True),
|
||||
sa.Column("detail", postgresql.JSONB(), nullable=False, server_default="{}"),
|
||||
sa.Column("at", sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()),
|
||||
)
|
||||
op.create_index("job_events_attachment_idx", "job_events", ["attachment_id", "id"])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
raise RuntimeError("Downgrade would delete pipeline data")
|
||||
@@ -0,0 +1,20 @@
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = "0005_failed_registry"
|
||||
down_revision = "0004_jobs"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_index(
|
||||
"jobs_failed_idx",
|
||||
"jobs",
|
||||
[sa.column("updated_at").desc()],
|
||||
postgresql_where=sa.column("status") == "failed",
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index("jobs_failed_idx", table_name="jobs")
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = "0004_attachment_quarantine"
|
||||
down_revision = "0003_attachments"
|
||||
revision = "0006_attachment_quarantine"
|
||||
down_revision = "0005_failed_registry"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy.dialects.postgresql import JSONB
|
||||
|
||||
revision = "0007_trace_context"
|
||||
down_revision = "0006_attachment_quarantine"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
for table in ("jobs", "outbox"):
|
||||
op.add_column(
|
||||
table, sa.Column("trace_context", JSONB(), nullable=False, server_default="{}")
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
raise RuntimeError("Downgrade would delete trace correlation data")
|
||||
@@ -1,12 +1,17 @@
|
||||
# Topology worksheet, deliberately NOT a runnable stack (no application supplied).
|
||||
# Implement compose.yaml or stack.yaml; do not submit this empty file as deployment.
|
||||
# Service names below are logical roles, not imposed container names.
|
||||
x-lab-number: 4
|
||||
x-lab-number: 6
|
||||
x-required-roles:
|
||||
- api
|
||||
- postgres
|
||||
- load_balancer
|
||||
- s3
|
||||
- broker
|
||||
- worker
|
||||
- otel_collector
|
||||
- telemetry_storage
|
||||
- grafana
|
||||
# TODO: implement real images/builds, network wiring, volumes, healthchecks,
|
||||
# credentials and bootstrap. Details: contracts/infrastructure.json and README.md.
|
||||
services: {}
|
||||
|
||||
+317
-3
@@ -18,6 +18,69 @@ x-s3-env: &s3-env
|
||||
UPLOAD_SWEEP_INTERVAL_SECONDS: ${UPLOAD_SWEEP_INTERVAL_SECONDS:-30}
|
||||
UPLOAD_SWEEP_BATCH: ${UPLOAD_SWEEP_BATCH:-100}
|
||||
|
||||
x-pipeline: &pipeline
|
||||
image: ${API_IMAGE:-mtusi-messenger:${COMPOSE_PROJECT_NAME}}
|
||||
pull_policy: never
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
read_only: true
|
||||
tmpfs: [/tmp]
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
cap_drop: [ALL]
|
||||
stop_grace_period: 10s
|
||||
networks: [backend]
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import os,sys,time;sys.exit(time.time()-os.stat('/tmp/heartbeat').st_mtime>30)"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
start_interval: 2s
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
s3-init:
|
||||
condition: service_completed_successfully
|
||||
broker:
|
||||
condition: service_healthy
|
||||
|
||||
x-otel-env: &otel-env
|
||||
OTEL_SDK_DISABLED: ${OTEL_SDK_DISABLED:-false}
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4318}
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: ${OTEL_EXPORTER_OTLP_PROTOCOL:-http/protobuf}
|
||||
OTEL_EXPORTER_OTLP_TIMEOUT: ${OTEL_EXPORTER_OTLP_TIMEOUT:-2}
|
||||
OTEL_RESOURCE_ATTRIBUTES: ${OTEL_RESOURCE_ATTRIBUTES:-deployment.environment.name=lab}
|
||||
OTEL_SEMCONV_STABILITY_OPT_IN: http
|
||||
OTEL_METRIC_EXPORT_INTERVAL: ${OTEL_METRIC_EXPORT_INTERVAL:-10000}
|
||||
OTEL_BSP_MAX_QUEUE_SIZE: ${OTEL_BSP_MAX_QUEUE_SIZE:-2048}
|
||||
OTEL_BLRP_MAX_QUEUE_SIZE: ${OTEL_BLRP_MAX_QUEUE_SIZE:-2048}
|
||||
TELEMETRY_SHUTDOWN_SECONDS: ${TELEMETRY_SHUTDOWN_SECONDS:-2}
|
||||
|
||||
x-obs-logging: &obs-logging
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
max-file: "3"
|
||||
|
||||
x-obs-hardening: &obs-hardening
|
||||
restart: unless-stopped
|
||||
stop_grace_period: 10s
|
||||
cap_drop: [ALL]
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
logging: *obs-logging
|
||||
|
||||
x-pipeline-env: &pipeline-env
|
||||
<<: [*s3-env, *otel-env]
|
||||
DATABASE_URL_FILE: /run/secrets/database_url
|
||||
BROKER_URL_FILE: /run/secrets/broker_url
|
||||
DB_POOL_MAX_SIZE: ${PIPELINE_DB_POOL_MAX_SIZE:-4}
|
||||
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
||||
HEARTBEAT_FILE: /tmp/heartbeat
|
||||
JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5}
|
||||
JOB_TIMEOUT_SECONDS: ${JOB_TIMEOUT_SECONDS:-60}
|
||||
JOB_BACKOFF_BASE_SECONDS: ${JOB_BACKOFF_BASE_SECONDS:-2}
|
||||
STAGING_RETENTION_SECONDS: ${STAGING_RETENTION_SECONDS:-86400}
|
||||
|
||||
x-s3-client: &s3-client
|
||||
image: rustfs/rc:v0.1.36@sha256:ab024bfebee49a750ce886b4c70963ccd9ddaa03f491704a90710641d7a26699
|
||||
read_only: true
|
||||
@@ -35,6 +98,8 @@ x-s3-client: &s3-client
|
||||
- s3_secret_access_key
|
||||
- s3_reconciler_access_key_id
|
||||
- s3_reconciler_secret_access_key
|
||||
- s3_worker_access_key_id
|
||||
- s3_worker_secret_access_key
|
||||
cap_drop: [ALL]
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
restart: "no"
|
||||
@@ -50,8 +115,8 @@ services:
|
||||
API_SERVER_MAXCONN: ${API_SERVER_MAXCONN:-64}
|
||||
volumes: [./infra/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro]
|
||||
ports:
|
||||
- "127.0.0.1:${LB_HTTP_PORT:-8080}:8080"
|
||||
- "127.0.0.1:${LB_STATS_PORT:-8404}:8404"
|
||||
- "127.0.0.1:${LB_HTTP_PORT:-18086}:8080"
|
||||
- "127.0.0.1:${LB_STATS_PORT:-26085}:8404"
|
||||
networks: [edge, backend]
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8404/healthz"]
|
||||
@@ -76,7 +141,8 @@ services:
|
||||
<<: *app
|
||||
build: .
|
||||
environment:
|
||||
<<: *s3-env
|
||||
<<: [*s3-env, *otel-env]
|
||||
OTEL_SERVICE_NAME: ${OTEL_SERVICE_NAME:-messenger-api}
|
||||
DATABASE_URL_FILE: /run/secrets/database_url
|
||||
CACHE_URL_FILE: /run/secrets/cache_url
|
||||
CURSOR_SECRET_FILE: /run/secrets/cursor_secret
|
||||
@@ -276,6 +342,79 @@ services:
|
||||
profiles: [tools]
|
||||
entrypoint: ["/bin/sh", "/s3/cli.sh"]
|
||||
|
||||
broker:
|
||||
image: rabbitmq:4.1.8-management-alpine@sha256:54ef5ff505352c1beef05a97ee9bd6ab95b3559a76629ba0119b1d63d8d6e4b2
|
||||
hostname: broker
|
||||
user: "100:101"
|
||||
restart: unless-stopped
|
||||
read_only: true
|
||||
tmpfs: [/tmp]
|
||||
security_opt: ["no-new-privileges:true"]
|
||||
cap_drop: [ALL]
|
||||
ports:
|
||||
- "127.0.0.1:${BROKER_MANAGEMENT_PORT:-26086}:15672"
|
||||
networks: [backend, edge]
|
||||
volumes:
|
||||
- broker-data:/var/lib/rabbitmq
|
||||
- ./infra/rabbitmq/rabbitmq.conf:/etc/rabbitmq/conf.d/20-messenger.conf:ro
|
||||
- ./infra/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
|
||||
- ./infra/rabbitmq/definitions.json:/etc/rabbitmq/definitions.d/10-topology.json:ro
|
||||
secrets:
|
||||
- source: rabbitmq_users
|
||||
target: /etc/rabbitmq/definitions.d/20-users.json
|
||||
- rabbitmq_ops_password
|
||||
healthcheck:
|
||||
test: ["CMD", "rabbitmq-diagnostics", "-q", "check_port_connectivity"]
|
||||
interval: 10s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
start_interval: 2s
|
||||
stop_grace_period: 10s
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "1", memory: 512m}
|
||||
|
||||
relay:
|
||||
<<: *pipeline
|
||||
command: ["python", "-m", "messenger.relay"]
|
||||
environment:
|
||||
<<: *pipeline-env
|
||||
OTEL_SERVICE_NAME: messenger-relay
|
||||
OUTBOX_POLL_SECONDS: ${OUTBOX_POLL_SECONDS:-1}
|
||||
SWEEP_INTERVAL_SECONDS: ${SWEEP_INTERVAL_SECONDS:-5}
|
||||
secrets:
|
||||
- database_url
|
||||
- source: broker_url_api
|
||||
target: broker_url
|
||||
- s3_access_key_id
|
||||
- s3_secret_access_key
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "0.5", memory: 192m}
|
||||
|
||||
worker:
|
||||
<<: *pipeline
|
||||
command: ["python", "-m", "messenger.worker"]
|
||||
environment:
|
||||
<<: *pipeline-env
|
||||
OTEL_SERVICE_NAME: messenger-worker
|
||||
WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-2}
|
||||
RENDER_TIMEOUT_SECONDS: ${RENDER_TIMEOUT_SECONDS:-30}
|
||||
RENDER_MEMORY_MB: ${RENDER_MEMORY_MB:-448}
|
||||
RENDER_TASKS_PER_CHILD: ${RENDER_TASKS_PER_CHILD:-100}
|
||||
secrets:
|
||||
- database_url
|
||||
- source: broker_url_worker
|
||||
target: broker_url
|
||||
- source: s3_worker_access_key_id
|
||||
target: s3_access_key_id
|
||||
- source: s3_worker_secret_access_key
|
||||
target: s3_secret_access_key
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "${WORKER_CPUS:-2}", memory: "${WORKER_MEMORY:-1g}"}
|
||||
|
||||
k6:
|
||||
image: grafana/k6:2.3.0@sha256:2dd4756ec6e14e62778916e1eb850108e4b499304c02df56760fa0bdb0fba0b8
|
||||
profiles: [bench]
|
||||
@@ -287,6 +426,161 @@ services:
|
||||
resources:
|
||||
limits: {cpus: "${K6_CPUS:-2}", memory: "${K6_MEMORY:-512m}"}
|
||||
|
||||
healthtools:
|
||||
image: busybox:1.37.0-musl@sha256:5cec3fc171c87218698e85a52af7087de727372aae264a787b8112901a5b0092
|
||||
command: ["cp", "/bin/busybox", "/hc/busybox"]
|
||||
restart: "no"
|
||||
network_mode: none
|
||||
volumes:
|
||||
- healthtools:/hc
|
||||
logging: *obs-logging
|
||||
|
||||
otel-collector:
|
||||
<<: *obs-hardening
|
||||
image: otel/opentelemetry-collector-contrib:0.163.2@sha256:7f22d2a6748110ffb6a59bc0df448bccbf501cdb667d610ede4c61d3863d5849
|
||||
command: ["--config=/etc/otelcol/collector.yaml"]
|
||||
networks: [backend, edge]
|
||||
environment:
|
||||
GOMEMLIMIT: 200MiB
|
||||
volumes:
|
||||
- ./infra/otel:/etc/otelcol:ro
|
||||
- healthtools:/hc:ro
|
||||
depends_on:
|
||||
healthtools:
|
||||
condition: service_completed_successfully
|
||||
healthcheck:
|
||||
test: ["CMD", "/hc/busybox", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:13133/"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 6
|
||||
start_period: 10s
|
||||
start_interval: 2s
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "0.50", memory: 256M}
|
||||
|
||||
prometheus:
|
||||
<<: *obs-hardening
|
||||
image: prom/prometheus:v3.15.1@sha256:fa3302279710be2f21a8301ec17a8b4f2301fd829bd113839b3b6b02b6f191a2
|
||||
command:
|
||||
- --config.file=/etc/prometheus/prometheus.yml
|
||||
- --storage.tsdb.path=/prometheus
|
||||
- --storage.tsdb.retention.time=${PROMETHEUS_RETENTION:-7d}
|
||||
- --storage.tsdb.retention.size=1GB
|
||||
- --web.enable-otlp-receiver
|
||||
- --enable-feature=exemplar-storage
|
||||
networks: [backend, edge]
|
||||
volumes:
|
||||
- ./infra/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- ./infra/prometheus/rules:/etc/prometheus/rules:ro
|
||||
- prometheus-data:/prometheus
|
||||
ports:
|
||||
- "127.0.0.1:${PROMETHEUS_PORT:-26090}:9090"
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:9090/-/ready"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 6
|
||||
start_period: 15s
|
||||
start_interval: 2s
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "0.50", memory: 512M}
|
||||
|
||||
loki:
|
||||
<<: *obs-hardening
|
||||
image: grafana/loki:3.7.9@sha256:0db216b630ae1f348a1584c67f3cead8b4c1fc839169a39501db664744158e28
|
||||
command: ["-config.file=/etc/loki/loki.yaml"]
|
||||
networks: [edge]
|
||||
environment:
|
||||
GOMEMLIMIT: 300MiB
|
||||
volumes:
|
||||
- ./infra/loki/loki.yaml:/etc/loki/loki.yaml:ro
|
||||
- loki-data:/loki
|
||||
- healthtools:/hc:ro
|
||||
depends_on:
|
||||
healthtools:
|
||||
condition: service_completed_successfully
|
||||
ports:
|
||||
- "127.0.0.1:${LOKI_PORT:-26310}:3100"
|
||||
healthcheck:
|
||||
test: ["CMD", "/hc/busybox", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:3100/ready"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
start_interval: 2s
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "0.50", memory: 384M}
|
||||
|
||||
tempo:
|
||||
<<: *obs-hardening
|
||||
image: grafana/tempo:2.10.10@sha256:12b0820f13ffa10ce956b6e9acc3b03f3cffded99109be6cc09d106fe56e5d38
|
||||
command: ["-config.file=/etc/tempo/tempo.yaml"]
|
||||
networks: [edge]
|
||||
environment:
|
||||
GOMEMLIMIT: 300MiB
|
||||
volumes:
|
||||
- ./infra/tempo/tempo.yaml:/etc/tempo/tempo.yaml:ro
|
||||
- tempo-data:/var/tempo
|
||||
- healthtools:/hc:ro
|
||||
depends_on:
|
||||
healthtools:
|
||||
condition: service_completed_successfully
|
||||
ports:
|
||||
- "127.0.0.1:${TEMPO_PORT:-26320}:3200"
|
||||
healthcheck:
|
||||
test: ["CMD", "/hc/busybox", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:3200/ready"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
start_interval: 2s
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "0.50", memory: 384M}
|
||||
|
||||
grafana:
|
||||
<<: *obs-hardening
|
||||
image: grafana/grafana:12.4.14@sha256:ae509d9ae8c1021ca32ec370a9ca975d40165eda9fccd1e1102d317ff8787cd7
|
||||
networks: [edge]
|
||||
environment:
|
||||
GF_SECURITY_ADMIN_USER: admin
|
||||
GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/grafana_admin_password
|
||||
GF_USERS_ALLOW_SIGN_UP: "false"
|
||||
GF_AUTH_ANONYMOUS_ENABLED: "false"
|
||||
GF_ANALYTICS_REPORTING_ENABLED: "false"
|
||||
GF_ANALYTICS_CHECK_FOR_UPDATES: "false"
|
||||
GF_ANALYTICS_CHECK_FOR_PLUGIN_UPDATES: "false"
|
||||
GF_NEWS_NEWS_FEED_ENABLED: "false"
|
||||
GF_PLUGINS_PREINSTALL_DISABLED: "true"
|
||||
GF_LOG_LEVEL: warn
|
||||
secrets: [grafana_admin_password]
|
||||
volumes:
|
||||
- ./infra/grafana/provisioning:/etc/grafana/provisioning:ro
|
||||
- ./infra/grafana/dashboards:/etc/grafana/dashboards:ro
|
||||
- grafana-data:/var/lib/grafana
|
||||
depends_on:
|
||||
prometheus:
|
||||
condition: service_started
|
||||
loki:
|
||||
condition: service_started
|
||||
tempo:
|
||||
condition: service_started
|
||||
ports:
|
||||
- "127.0.0.1:${GRAFANA_PORT:-26300}:3000"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "-o", "/dev/null", "http://127.0.0.1:3000/api/health"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
start_interval: 2s
|
||||
deploy:
|
||||
resources:
|
||||
limits: {cpus: "0.50", memory: 384M}
|
||||
|
||||
secrets:
|
||||
postgres_password:
|
||||
file: ./secrets/postgres_password
|
||||
@@ -306,6 +600,20 @@ secrets:
|
||||
file: ./secrets/s3_access_key_id
|
||||
s3_secret_access_key:
|
||||
file: ./secrets/s3_secret_access_key
|
||||
s3_worker_access_key_id:
|
||||
file: ./secrets/s3_worker_access_key_id
|
||||
s3_worker_secret_access_key:
|
||||
file: ./secrets/s3_worker_secret_access_key
|
||||
rabbitmq_users:
|
||||
file: ./secrets/rabbitmq_users.json
|
||||
rabbitmq_ops_password:
|
||||
file: ./secrets/rabbitmq_ops_password
|
||||
broker_url_api:
|
||||
file: ./secrets/broker_url_api
|
||||
broker_url_worker:
|
||||
file: ./secrets/broker_url_worker
|
||||
grafana_admin_password:
|
||||
file: ./secrets/grafana_admin_password
|
||||
s3_reconciler_access_key_id:
|
||||
file: ./secrets/s3_reconciler_access_key_id
|
||||
s3_reconciler_secret_access_key:
|
||||
@@ -315,6 +623,12 @@ volumes:
|
||||
pgdata:
|
||||
valkeydata:
|
||||
s3data:
|
||||
broker-data:
|
||||
healthtools:
|
||||
prometheus-data:
|
||||
loki-data:
|
||||
tempo-data:
|
||||
grafana-data:
|
||||
|
||||
networks:
|
||||
edge:
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# Состояния вложения и договор между producer/worker
|
||||
|
||||
Сообщение broker соответствует [jobs.schema.json](jobs.schema.json). Можно применять native headers брокера для trace context, но семантика carrier сохраняется; для проверки покажите отображение полей. `job_id` идентифицирует одну логическую работу и не меняется при redelivery; `attempt` начинается с 1 и отражает управляемую попытку обработки (broker redelivery сам по себе не создаёт новый job_id). Ключ эффекта — `(attachment_id, pipeline_version, variant)`.
|
||||
|
||||
| Переход | Условие | Что устойчиво сохранено |
|
||||
| --- | --- | --- |
|
||||
| нет → queued | Принимаем upload; только после durable handoff отвечаем 202 | Полный проверенный оригинал в staging, метаданные, намерение обработки |
|
||||
| queued → processing | Worker захватил/арендовал работу | Попытка, lease/deadline или эквивалентная защита |
|
||||
| processing → queued | Временная ошибка и остались попытки | Причина без секретов, время следующей попытки |
|
||||
| processing → ready | Все обязательные объекты записаны и результат атомарно опубликован | Оригинал, thumbnail (на 4 ещё crop/optimized), метаданные/checksums |
|
||||
| processing → failed | Ошибка постоянная или попытки исчерпаны | error_code и запись, доступная оператору |
|
||||
| processing → queued | Истёк lease после смерти worker | Восстановленная работа, без дублирования эффектов |
|
||||
| failed → queued | Явный операторский replay, доступен на 4 | Audit, новая попытка, прежний логический эффект защищён от дубля |
|
||||
|
||||
Повторная доставка уже ready-задачи — no-op с ack после проверки завершённого эффекта. Конкурентные попытки не перезаписывают более новый pipeline_version. Основной курс использует pipeline_version=1; версионирование нескольких pipeline — трек 5. Заявляйте готовность только когда все обещанные уровнем варианты доступны. Нельзя откатывать ready в processing из-за старого дубля.
|
||||
|
||||
**Окна отказа для защиты:** после staging до записи задания; после COMMIT до publish; после publish до confirm; после записи S3 до COMMIT результата; после COMMIT результата до ack. На 3 покажите сохранность успешно принятой работы и повторную доставку; на 4 автоматическое восстановление разрыва DB/broker (outbox/эквивалент) и зависшего processing.
|
||||
|
||||
Staging не удаляется до безопасной публикации результатов. Неуспешные/непривязанные исходники имеют документированный retention и cleanup; он не удаляет текущую работу. Broker принимает только ID/служебные данные, не произвольный URL для скачивания и не путь из клиентского filename. Worker берёт доверенные storage metadata из БД.
|
||||
|
||||
Ack подтверждает устойчивую обработку, publisher confirm — приём брокером; это разные границы. См. [RabbitMQ reliability](https://www.rabbitmq.com/docs/reliability). At-least-once + идемпотентный эффект не означает exactly-once доставку.
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"lab": 4,
|
||||
"lab": 6,
|
||||
"kind": "requirements, not runnable deployment",
|
||||
"required_for_grade_3": [
|
||||
{
|
||||
@@ -27,6 +27,48 @@
|
||||
],
|
||||
"private_bucket": true,
|
||||
"persistent_volume": true
|
||||
},
|
||||
{
|
||||
"role": "broker",
|
||||
"choose_one": [
|
||||
"RabbitMQ",
|
||||
"Redis Streams",
|
||||
"Valkey Streams",
|
||||
"NATS JetStream",
|
||||
"documented durable equivalent"
|
||||
],
|
||||
"persistent_volume": true,
|
||||
"delivery": "at-least-once"
|
||||
},
|
||||
{
|
||||
"role": "worker",
|
||||
"separate_process": true
|
||||
},
|
||||
{
|
||||
"role": "otel_collector",
|
||||
"signals": [
|
||||
"metrics",
|
||||
"logs",
|
||||
"traces"
|
||||
]
|
||||
},
|
||||
{
|
||||
"role": "telemetry_storage",
|
||||
"signals": [
|
||||
"metrics",
|
||||
"logs",
|
||||
"traces"
|
||||
],
|
||||
"possible_combination": [
|
||||
"Prometheus",
|
||||
"Loki",
|
||||
"Tempo"
|
||||
],
|
||||
"persistent_volume": true
|
||||
},
|
||||
{
|
||||
"role": "grafana",
|
||||
"provisioning_in_git": true
|
||||
}
|
||||
],
|
||||
"optional_components": [
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "urn:mtusi:messenger:attachment-job:v1",
|
||||
"title": "Durable attachment processing job v1",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"schema_version",
|
||||
"job_id",
|
||||
"type",
|
||||
"attachment_id",
|
||||
"pipeline_version",
|
||||
"attempt",
|
||||
"created_at"
|
||||
],
|
||||
"properties": {
|
||||
"schema_version": {
|
||||
"const": 1
|
||||
},
|
||||
"job_id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"type": {
|
||||
"const": "attachment.process.v1"
|
||||
},
|
||||
"attachment_id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"pipeline_version": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"attempt": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"traceparent": {
|
||||
"type": "string",
|
||||
"pattern": "^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$"
|
||||
},
|
||||
"tracestate": {
|
||||
"type": "string",
|
||||
"maxLength": 512
|
||||
}
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"schema_version": 1,
|
||||
"job_id": "11111111-1111-4111-8111-111111111111",
|
||||
"type": "attachment.process.v1",
|
||||
"attachment_id": "22222222-2222-4222-8222-222222222222",
|
||||
"pipeline_version": 1,
|
||||
"attempt": 1,
|
||||
"created_at": "2026-09-01T12:00:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
# Контракт наблюдаемости
|
||||
|
||||
Ниже логические сигналы. Допустимы стандартные semantic conventions выбранного SDK и их native metric names: зафиксируйте соответствие в `REPORT.md`, dashboard обязан ссылаться на реально существующие имена/единицы. Переименование SDK не повод дублировать одну метрику двумя инструментами. Версии SDK, semantic conventions, Collector distribution и backend закрепляются в решении.
|
||||
|
||||
| Сигнал | Минимальные поля/измерения | Уровень |
|
||||
| --- | --- | --- |
|
||||
| HTTP requests | method, route template, status class; counter | 3 |
|
||||
| HTTP duration | histogram в секундах или документированное преобразование из ms | 3 |
|
||||
| Jobs processed / failed | job type, outcome, counter | 3 |
|
||||
| Job processing duration | job type, outcome, histogram | 3 |
|
||||
| API и worker logs | timestamp, severity, service.name, event, trace_id, span_id при активном span | 3 |
|
||||
| API и worker traces | реальные server/consumer spans, duration, outcome; не искусственный статический trace | 3 |
|
||||
| Queue depth / oldest job age | queue name, количество / секунды | 4 |
|
||||
| Pool/saturation | DB pool used/waiting, worker busy/capacity, process/container CPU/RAM | 4 |
|
||||
| Сквозная связь upload → publish → consume → S3/DB | W3C traceparent/tracestate; parent-child или link по выбранной семантике | 4 |
|
||||
| End-to-end time to ready | от durable acceptance до публикации ready, histogram | 4 |
|
||||
|
||||
Resource attributes: `service.name` (messenger-api / messenger-worker), `service.version`, `service.instance.id`, `deployment.environment.name=lab`. Список имён может отличаться, если явно сопоставлен. `X-Request-Id` коррелирует HTTP-ошибку с логом; trace_id — не замена всех request IDs.
|
||||
|
||||
**Не labels метрик:** user_id, chat_id, message_id, attachment_id, request_id, raw URL, filename, текст. Для маршрута используйте `/api/v1/chats/{chat_id}/messages`, не реальный UUID. В логах/трассах допустимы ограниченные технические ID для учебных синтетических данных, если обоснована необходимость; пароли, Authorization, session token, body сообщения, картинка, private key и signed URL запрещены.
|
||||
|
||||
Для HTTP error ratio заранее определите numerator/denominator: например 5xx/все бизнес-запросы, исключая health; не смешивайте неверный пароль клиента с отказом БД. p95 агрегируется из histogram buckets всех нужных реплик, а не средних p95. Границы buckets должны соответствовать ожидаемым задержкам. Backlog — не queue processing latency.
|
||||
|
||||
В Git находятся Collector config, backend configs, datasources/dashboard provisioning, dashboard JSON и на 4 alert rules. У alerts есть условие, окно, порог, `for` при необходимости, описание и локальный runbook. Отправка сообщений в почту/мессенджер не требуется.
|
||||
|
||||
Минимальные контролируемые инциденты для 4: (1) остановить worker и увидеть рост возраста задач; (2) сделать DB медленной/недоступной и отличить её от медленного HTTP handler по trace/метрикам. После восстановления backlog уменьшается, alerts resolved. Третий сценарий — недоступность backend telemetry: SDK/Collector ограничивают RAM/очередь, API сохраняет работу, потери telemetry считаются и объясняются.
|
||||
|
||||
Collector — получатель/обработчик/экспортёр, не долговременная БД. Grafana — интерфейс и запросы к источникам. Логи можно отправлять OTLP в совместимый backend; не закладывайте удалённый/устаревший exporter без проверки текущей сборки. См. [Collector configuration](https://opentelemetry.io/docs/collector/configuration/), [Trace Context](https://www.w3.org/TR/trace-context/) и [histograms](https://prometheus.io/docs/practices/histograms/).
|
||||
+11
-5
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"openapi": "3.1.0",
|
||||
"info": {
|
||||
"title": "MTUSI Messenger — лабораторная 4",
|
||||
"version": "1.4.0",
|
||||
"title": "MTUSI Messenger — лабораторная 6",
|
||||
"version": "1.6.0",
|
||||
"description": "Нормативный минимум на 3. Семантика: contracts/README.md. Расширения на 4/5 не должны менять этот API. Наличие кода ошибки в схеме не требует реализовать факультативную причину его выдачи."
|
||||
},
|
||||
"servers": [
|
||||
@@ -2151,7 +2151,7 @@
|
||||
"operationId": "uploadAttachment",
|
||||
"summary": "Принять один PNG/JPEG, до 10 MiB",
|
||||
"responses": {
|
||||
"201": {
|
||||
"202": {
|
||||
"description": "Успех",
|
||||
"headers": {
|
||||
"X-Request-Id": {
|
||||
@@ -2936,7 +2936,10 @@
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"original"
|
||||
"original",
|
||||
"thumbnail",
|
||||
"crop",
|
||||
"optimized"
|
||||
],
|
||||
"default": "original"
|
||||
}
|
||||
@@ -3461,7 +3464,10 @@
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ready"
|
||||
"queued",
|
||||
"processing",
|
||||
"ready",
|
||||
"failed"
|
||||
]
|
||||
},
|
||||
"variants": {
|
||||
|
||||
+3
-110
@@ -1,112 +1,5 @@
|
||||
# Индекс доказательств ЛР4
|
||||
# Доказательства
|
||||
|
||||
Финальный validation snapshot: `5e49502ae78fa48b992c97418e490666c699726d`, 2026-11-06.
|
||||
Runtime совпадает с review `7a0ebac2aa9e1d8602054ca4c7c1b0c23d3bfad4`;
|
||||
[аудит применимости и новые проверки](load-validation.md). Сохранённые cost и текстовая
|
||||
нагрузка приняты с исходными SHA. Старые upload-memory остаются историческими.
|
||||
Храните небольшие обезличенные результаты: команды и stdout проверок, JSON/CSV агрегатов нагрузки, EXPLAIN, dashboard JSON, текст разбора отказа. Укажите дату, commit, аппаратные лимиты и профиль нагрузки.
|
||||
|
||||
## Финальная validation после PNG-фиксов
|
||||
|
||||
| Команда / назначение | Наблюдение | Файл |
|
||||
| --- | --- | --- |
|
||||
| `make student-test PYTEST_ARGS='-q --tb=short'`, затем адресный повтор двух S3-тестов | 719 PASS + 2 setup errors RustFS; только эти два повторены: 2 PASS. 721 выбранная проверка исполнена; первый запуск не объявлен зелёным | [полный](png-final-2026-11-06/student-test.txt), [повтор](png-final-2026-11-06/student-s3-retry.txt) |
|
||||
| `make up`, `make test`, `scripts/limits.py` | Новый изолированный project, fresh volumes, штатные лимиты, smoke PASS | [up](png-final-2026-11-06/up.txt), [smoke](png-final-2026-11-06/smoke.txt), [лимиты](png-final-2026-11-06/limits.txt) |
|
||||
| Прямой argv `make upload-faults`, новый путь захвата | 7 PASS; оба PNG → 415; негативный suite: 0×5xx | [raw](png-final-2026-11-06/upload-faults.txt) |
|
||||
| `png-roundtrip.py` | 415 без новых строк/объектов; PNG/JPEG → 201 и побайтное скачивание | [raw](png-final-2026-11-06/png-roundtrip.json) |
|
||||
| `make upload-memory ARGS='--slots 3 --out <новый-runN>'`, 3 серии | 18 точек, 840/840×201, API ≤440 MiB, LB ≤31,1 MiB, OOM 0 | [сводка](png-final-2026-11-06/memory-summary.json), [raw](png-final-2026-11-06/upload-memory/) |
|
||||
| `high-depth.py` | 10 параллельных 40 MP RGBA16, 10×201, checksum совпал, API ≤270,828 MiB, OOM 0 | [raw](png-final-2026-11-06/high-depth.json) |
|
||||
| `scripts/reconcile_check.py` после RAM | 859 ready = 859 объектов, расхождений/остатков нет; shallow | [raw](png-final-2026-11-06/post-memory-invariants.json) |
|
||||
| `concurrent-reconcile.py` (только under_load) | 3341×201, 67 проходов, 3 orphan удалены; deep SHA/lost_ready=0. Pending инъекция 0 на пустом dataset, прежний сценарий F сохранён | [raw](png-final-2026-11-06/concurrent-reconcile/under-load.json), [oracle](png-final-2026-11-06/concurrent-reconcile/check-under-load.json) |
|
||||
| Повторный аудит 27 cost-замеров | Приняты все 27; страницы/память подтверждены, линейность времени отвергнута | [аудит](png-final-2026-11-06/cost-reaudit.json), [diff/SHA](png-final-2026-11-06/retained-audit.json) |
|
||||
|
||||
## Offline-проверки до финальной validation
|
||||
|
||||
| Команда / назначение | Результат | SHA и файлы |
|
||||
| --- | --- | --- |
|
||||
| `make student-test PYTEST_ARGS='-q --tb=short student-tests/unit'` | 407 passed; оба повреждённых PNG отклоняются до записи | Код `7c8a1a64899dc0a1b5fa0949c0992ef40722eacf`; [unit](png-header-fix/unit.txt), [227 проверок инспектора/ASGI](png-header-fix/targeted.txt), [blob-манифест](png-header-fix/manifest.json) |
|
||||
| `make check`, `make validate`, `make lint`, `openspec validate --all --strict --no-interactive` после фикса | PASS, 18 спецификаций после архивации | Архив `7a0ebac2aa9e1d8602054ca4c7c1b0c23d3bfad4`; [протокол](png-header-fix/NOTES.md), [OpenSpec](png-header-fix/openspec-final.txt) |
|
||||
| Статическое/offline-ревью runner, round3 | Открытых major нет, один minor; Docker/нагрузки не выполнялись | Результат передан runner для `7a0ebac2aa9e1d8602054ca4c7c1b0c23d3bfad4`; отдельного raw-файла ревью в репозитории нет |
|
||||
| Документационный аудит: check/validate/lint/OpenSpec, числа, ссылки, diff | Проверки отчётного этапа отдельно от предыдущих тестов | [Аудит](report-audit-2026-11-06.md); исходный snapshot указан выше |
|
||||
| Финальные API/LB/RustFS-регрессии, память нового инспектора и upload при сверке | Выполненные результаты финальной фазы вынесены выше и в аудит применимости | [Общий долг двух PNG-фиксов](png-header-fix/NOTES.md#обязательные-проверки-финального-этапа) |
|
||||
|
||||
Первый PNG-фикс: `9387c3d82ab77ea376eecce19a36a22803d35efb`,
|
||||
[причина и offline-доказательства](png-validation-fix/NOTES.md).
|
||||
Второй фикс требует единственный IHDR; вместе они добавляют распаковку PNG ограниченными
|
||||
блоками. Все предыдущие upload-memory и конкурентные upload в исторических разделах ниже
|
||||
относятся к старому инспектору. Collection API/stack в `png-header-fix/` — сбор тестов, не их исполнение.
|
||||
|
||||
## После позднего переноса ЛР3, до PNG-фиксов
|
||||
|
||||
Runtime SHA **F**: `75b93bbba5f29575d3fca1d013cc7e0770d88082`, архив
|
||||
`8bc2da2c094afc7e5f5e97c7beb5f278e76253fd`. Источник — immutable snapshot ЛР3
|
||||
`ba78cf6da439a4ec60fd59389583b38285b0b2b1`, диапазон от `f591fa64e525679a31c9db7f942d36c789e1a12f`.
|
||||
[Все 214 путей и область применимости](forward-port.md), [source-manifest](forward-final-2026-11-06/source-manifest.json).
|
||||
Все успешные команды таблицы — на F; их полный argv, UTC, разрешённое окружение и exit code
|
||||
находятся в raw. Пользователи, данные и файлы синтетические.
|
||||
|
||||
| Проверка / команда | Наблюдение | Файл |
|
||||
| --- | --- | --- |
|
||||
| `make check`, `make validate`, `make lint`, `make student-test` | PASS, 492 теста / 19 stack deselected | [offline-checks-rerun](forward-final-2026-11-06/offline-checks-rerun.txt) |
|
||||
| `make up`, `make test` | Обе реплики healthy; smoke/checksum/ACL PASS | [up](forward-final-2026-11-06/up.txt), [smoke](forward-final-2026-11-06/smoke.txt), [после нагрузок](forward-final-2026-11-06/final-smoke.txt) |
|
||||
| `sh scripts/persistence-evidence.sh http://127.0.0.1:18084` | PASS; StartedAt API/LB/PG/Valkey/S3 изменились | [persistence-rerun](forward-final-2026-11-06/persistence-rerun.txt) |
|
||||
| `make test-failover ACTION_SCRIPT=scripts/stop-one.sh` | Target exited; 130 записей, 0 ошибок, 2,883 с до первой записи | [команда](forward-final-2026-11-06/failover-command.txt), [вывод/inspect](forward-final-2026-11-06/failover-d4c8d53d7433.txt) |
|
||||
| `make scenario SCENARIO=failover-upload`; отдельный `make restore` | Другая реплика отдала те же байты; восстановление выполнено отдельно | [команда](forward-final-2026-11-06/failover-upload-command.txt), [JSON](forward-final-2026-11-06/failover-upload.json), [restore](forward-final-2026-11-06/restore.txt) |
|
||||
| `make scenario SCENARIO=s3-outage` | 503 за 4,990/5,329 с; текст 201; checksum после старта совпал | [команда](forward-final-2026-11-06/s3-outage-command.txt), [JSON](forward-final-2026-11-06/s3-outage.json) |
|
||||
| `make test-faults` | 19 PASS, 112 ответов негативной файловой проверки без 5xx; компенсация/crash/grace/stall/PG/Valkey | [stack-faults](forward-final-2026-11-06/stack-faults.txt) |
|
||||
| `student-tests/tools/forward_network.py`; HAProxy fixture | Сессии/NUL/Basic PASS; 12 проверок реальных 502/503/504 и request_id | [сеть](forward-final-2026-11-06/network-regressions.txt), [LB](forward-final-2026-11-06/haproxy-errors.txt) |
|
||||
| `make limits` | Ресурсы, порты, mounts, сети и роли секретов PASS | [limits](forward-final-2026-11-06/limits.txt) |
|
||||
| `make load-evidence` | 3 повтора, медиана 1456,338 RPS, 0 ошибок; текстовый путь не менялся | [команда](forward-final-2026-11-06/load-command.txt), [вывод](forward-final-2026-11-06/load.txt), [raw JSON](forward-final-2026-11-06/load/) |
|
||||
| `scripts/upload_memory.py --slots 3 --sizes 10485760 --levels 40 --out ...` | 3×80: 238×201, 2×503; пик API 456,2 MiB, OOM 0. Историческая память до PNG-фиксов | [run1](forward-final-2026-11-06/memory-1.txt), [run2](forward-final-2026-11-06/memory-2.txt), [run3](forward-final-2026-11-06/memory-3.txt), [raw](forward-final-2026-11-06/memory/) |
|
||||
| `make reconcile-demo ARGS='--out evidence/forward-final-2026-11-06/reconcile-demo'` | 13 PASS; 3364 upload, 59 проходов, lost_ready 0. Конкурентные upload требуют повторения после PNG-фиксов | [команда](forward-final-2026-11-06/reconcile-demo.txt), [demo](forward-final-2026-11-06/reconcile-demo/demo.json), [deep-аудит](forward-final-2026-11-06/reconcile-demo/check-under-load.json) |
|
||||
| `git diff --exit-code` измеряемых файлов | Стоимость reconciler сохранена с исходным SHA, не переснята на F | [retained-cost-audit](forward-final-2026-11-06/retained-cost-audit.txt) |
|
||||
| Воспроизведение непарных surrogate в text | Два HTTP 500: известный **minor**, не успешный тест | [HTTP](forward-final-2026-11-06/known-minor-http.txt), [offline](forward-final-2026-11-06/known-minor.txt), [finding](forward-final-2026-11-06/findings.json) |
|
||||
| `make down` своих project, fixture `docker compose down`, инвентаризация по labels | 0 контейнеров трёх project, 6 volumes сохранены | [main](forward-final-2026-11-06/main-down.txt), [demo](forward-final-2026-11-06/reconcile-down.txt), [итог](forward-final-2026-11-06/shutdown-state.txt) |
|
||||
|
||||
[Сводка чисел](forward-final-2026-11-06/measurement-summary.json),
|
||||
[команда агрегации](forward-final-2026-11-06/measurement-summary.txt),
|
||||
[фон до](forward-final-2026-11-06/performance-before.txt) и
|
||||
[после](forward-final-2026-11-06/performance-after.txt).
|
||||
Сохранены неуспешные попытки: [ty до исправления обвязки](forward-final-2026-11-06/offline-checks.txt)
|
||||
и [неверный BASE_URL до hook](forward-final-2026-11-06/persistence-command.txt); они не считаются PASS.
|
||||
|
||||
## Исходная SQLAlchemy-серия
|
||||
|
||||
Runtime основы: `8e4532f6f5c05d902b6e2c310f54320d95585904`. Все результаты ниже сняты
|
||||
**до F и обоих PNG-фиксов**. Обвязка менялась отдельно; точный SHA каждого захвата записан
|
||||
в его первой строке/JSON. [Общий протокол](sqlalchemy-2026-11-06/README.md).
|
||||
|
||||
| Команда / критерий | Наблюдение | SHA обвязки и файлы |
|
||||
| --- | --- | --- |
|
||||
| `make test`, `make limits`, `make attachments-evidence`, LB/retry/отказы | Уровень 3 на SQLAlchemy, 404 собственных теста | `1aec062aba4560b51a6d9155571c9610bc777d7e`, `763b0255575366082c4c6731b54611af717685a5`; [grade3](sqlalchemy-2026-11-06/grade3/NOTES.md) |
|
||||
| `make s3-check` | 31 PASS; private/IAM/bootstrap не менялись с этой серии | `763b0255575366082c4c6731b54611af717685a5`; [сырьё](sqlalchemy-2026-11-06/grade3/s3-security.txt) |
|
||||
| `make upload-memory`, три полные матрицы | 36 точек, штатные 3 слота 840/840×201, пик 448 MiB, OOM 0; контроль 64 слота 27×503 | `6c706a727ec7b4c5f8254e19401705847e8e9c78`, `cf41f7c64dcf1dea6da0643f5793bd2e5dd1f03e`; [методика](sqlalchemy-2026-11-06/grade4/NOTES.md), [raw](sqlalchemy-2026-11-06/grade4/memory/) |
|
||||
| `sh scripts/clean-clone.sh` | 76,866 с, проверки прошли, три volumes сохранены | `cf41f7c64dcf1dea6da0643f5793bd2e5dd1f03e`; [команда/вывод](sqlalchemy-2026-11-06/grade4/clean-clone-command.txt) |
|
||||
| `make overload-leftovers` | Без сдвига времени убраны 30 pending после grace 900 с; 1669 ready/объектов совпали | SHA в [команде](sqlalchemy-2026-11-06/grade4/leftovers-command.txt); [вывод](sqlalchemy-2026-11-06/grade4/overload-leftovers.txt) |
|
||||
| `make load-evidence` | 3 прогона, медиана 1529,186 RPS, 0 ошибок; историческая серия до F | SHA в [команде](sqlalchemy-2026-11-06/grade4/load-command.txt); [raw](sqlalchemy-2026-11-06/grade4/load/) |
|
||||
| `make reconcile-demo`, отдельный отказ PG | 13 PASS, 3331 upload, lost_ready 0; обновлён demo серии F | `827b783be355be9fa60117dc3eda350af3dab454`, `3402fd69d4922e500035a204d957be2cccaeb85a`; [протокол](sqlalchemy-2026-11-06/track5/NOTES.md), [PG](sqlalchemy-2026-11-06/track5/pg-outage.txt) |
|
||||
| `make reconcile-cost` | **Сохраняемые 27 замеров** до 100k; путь обхода неизменён | `3402fd69d4922e500035a204d957be2cccaeb85a`; [команда](sqlalchemy-2026-11-06/track5/cost-command.txt), [raw/план/фон](sqlalchemy-2026-11-06/track5/measurements/cost/), [расчёт](sqlalchemy-2026-11-06/track5/analysis.json) |
|
||||
| Финальные проверки исходной реализации | 410 тестов, check/validate/lint/smoke/limits PASS; не тесты нового PNG | `504f77cb7cef28202e1830fc04e10e646488e778`; [вывод](sqlalchemy-2026-11-06/track5/final-checks.txt), [остановка 4 project / 12 volumes](sqlalchemy-2026-11-06/track5/shutdown-state.txt) |
|
||||
|
||||
[Закрытие 21 замечания исходной реализации](sqlalchemy-2026-11-06/REVIEW-CLOSURE.md)
|
||||
относится к тому этапу. Оно предшествует независимым PNG-находкам и не отменяет их историю.
|
||||
|
||||
## Историческая реализация asyncpg
|
||||
|
||||
**Эти результаты не подтверждают нынешний SQLAlchemy-код или PNG-инспектор.**
|
||||
Основная серия и старый clean-clone: `81dd816df21f820a7fd0fa4269cc375d8fc44155`;
|
||||
reconciler: `61dcb6bf13f3d0853d36788930d79bca5f68ece6`. Дата и измеренный SHA
|
||||
сохранены в raw. Старые команды удаления volumes — история, не инструкция для повторения.
|
||||
|
||||
| Историческая команда | Сохранённые файлы |
|
||||
| --- | --- |
|
||||
| `make check`, `make validate`, `make student-test`, `make test` | [контракт](contract-checks.txt), [тесты](student-tests.txt), [smoke](smoke.txt) |
|
||||
| `make clean-clone-evidence`, `make stack-evidence`, `make limits`, `make attachments-evidence` | [clone](clean-clone.txt), [стенд](stack.txt), [окружение](environment.txt), [лимиты](limits.txt), [размещение](storage-layout.txt) |
|
||||
| `make lb-check`, `make retry-check`, persistence и сценарии отказов | [LB](lb-check.json), [retry](retry.json), [persistence](persistence.txt), [upload failover](failover-upload.json), [S3 outage](s3-outage.json) |
|
||||
| `make upload-faults`, `make faults-evidence`, `make s3-check` | [upload](upload-faults.txt), [stack](faults.txt), [S3](s3-security.txt) |
|
||||
| `make upload-memory`, `make overload-leftovers`, `make load-evidence` | [память](upload-memory/), [остатки](overload-leftovers.txt), [нагрузка](load.txt), [raw](load/), [отброшенная попытка с хоста](load/host-attempt.txt) |
|
||||
| `make reconcile-demo`, `make reconcile-cost` | [методика и все серии](reconcile/README.md), [raw](reconcile/), [cost](reconcile/cost/) |
|
||||
|
||||
Прежние cost-серии `b1916236f4391bfdf7d7718ebf741621047788cf` (лишняя SQL-страница),
|
||||
`5ca2cdc9af6016df8d6f1be8bd4681f06fada334` (без фильтра фона) и прерванные наполнения
|
||||
описаны в [историческом индексе reconciler](reconcile/README.md). Они не подмешиваются
|
||||
к 27 принятым измерениям SQLAlchemy и не удаляются.
|
||||
Не добавляйте .env, session tokens, cookies, приватные ключи, credentials, реальные сообщения, raw dumps и signed URLs. Для скриншотов скрывайте секреты. Большие логи/бинарные traces сохраняйте отдельно по правилам преподавателя; одного скриншота без методики недостаточно.
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
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
|
||||
@@ -1,12 +0,0 @@
|
||||
date: 2026-10-30T04:24:13Z commit: 81dd816
|
||||
$ make check
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
$ make validate # openapi-spec-validator 0.7.2 из .venv (make install)
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
$ git diff --stat upstream/main -- contracts tests README.md COURSE.md CONTRIBUTING.md MAINTAINERS.md lab.json compose.example.yaml Dockerfile.example # контракт, публичные тесты и задание не менялись
|
||||
(пусто)
|
||||
$ git diff --stat upstream/main -- .github # только свой CI job
|
||||
.github/workflows/application.yml | 93 +++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 93 insertions(+)
|
||||
@@ -1,41 +0,0 @@
|
||||
date: 2026-10-30T04:29:05Z commit: 81dd816
|
||||
host: Apple M4 Max, 16 CPU, 48 GiB RAM, macOS 15.1
|
||||
docker: 28.3.2, VM: 16 CPU, 8217190400 bytes
|
||||
compose: 2.38.2-desktop.1
|
||||
images:
|
||||
image: ${API_IMAGE:-mtusi-messenger:${COMPOSE_PROJECT_NAME}}
|
||||
image: rustfs/rc:v0.1.36@sha256:ab024bfebee49a750ce886b4c70963ccd9ddaa03f491704a90710641d7a26699
|
||||
image: haproxy:3.2.26-alpine@sha256:5893840576071e6217cd52ebdcc14f454c6f7a631056fa6f4e0f40d3cac4215b
|
||||
image: postgres:17.11-alpine@sha256:266d3c257594e195b309ae9d1805e54c788f1d7b375f56bf6c367aac6c917e7b
|
||||
image: valkey/valkey:8.1.11-alpine@sha256:2602ace2be6569bc2bbb06f873776516ab9089821525be34f4305c67eb9db02a
|
||||
image: rustfs/rustfs:1.0.4@sha256:ed9210d6411d77ffceb70d94b964a3cb7d225983368bc25bebe01e995293dcc2
|
||||
image: grafana/k6:2.3.0@sha256:2dd4756ec6e14e62778916e1eb850108e4b499304c02df56760fa0bdb0fba0b8
|
||||
FROM python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d AS builder
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /usr/local/bin/uv
|
||||
FROM python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d AS runtime
|
||||
python in image: Python 3.14.7
|
||||
haproxy: HAProxy version 3.2.26-3e0f11a 2026/10/14 - https://haproxy.org/
|
||||
rustfs: rustfs 1.0.4
|
||||
packages (uv.lock):
|
||||
fastapi 0.141.1
|
||||
uvicorn 0.54.0
|
||||
uvicorn-worker 0.4.0
|
||||
gunicorn 26.2.0
|
||||
asyncpg 0.32.0
|
||||
argon2-cffi 25.1.0
|
||||
pydantic 2.13.5
|
||||
pydantic-settings 2.15.0
|
||||
dishka 1.10.1
|
||||
structlog 26.1.0
|
||||
redis 8.1.0
|
||||
aiobotocore 3.10.0
|
||||
botocore 1.43.117
|
||||
aiohttp 3.14.5
|
||||
pillow 13.0.0
|
||||
process users (service uid command):
|
||||
api 10001 python
|
||||
lb 99 haproxy
|
||||
postgres 70 postgres
|
||||
s3 10001 rustfs
|
||||
valkey 999 tini
|
||||
valkey 999 valkey-server
|
||||
@@ -1,38 +0,0 @@
|
||||
date: 2026-10-30T04:29:33Z commit: 81dd816
|
||||
== before: api replicas (hostname = X-Instance-Id), state, StartedAt, FinishedAt
|
||||
0cc3ee358e59 running started=2026-10-30T04:28:59.851144131Z finished=0001-01-01T00:00:00Z
|
||||
899a952a5a21 running started=2026-10-30T04:29:31.104320507Z finished=2026-10-30T04:29:18.153900709Z
|
||||
$ 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.883}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
== after: api replicas
|
||||
0cc3ee358e59 exited started=2026-10-30T04:28:59.851144131Z finished=2026-10-30T04:29:36.57527926Z
|
||||
899a952a5a21 running started=2026-10-30T04:29:31.104320507Z finished=2026-10-30T04:29:18.153900709Z
|
||||
== stopped replica: 0cc3ee358e59; shutdown: signal, drain window with readiness 503, close, exit
|
||||
{"event":"Handling signal: term","level":"info","ts":"2026-10-30T04:29:34.045936Z"}
|
||||
{"limit":2.0,"event":"service.draining","level":"info","ts":"2026-10-30T04:29:34.072243Z"}
|
||||
{"limit":2.0,"event":"service.draining","level":"info","ts":"2026-10-30T04:29:34.126665Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"6362781446fb427cbee670871ce5ef51","duration_ms":1.463,"event":"request.handled","level":"info","ts":"2026-10-30T04:29:34.446815Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"0d9cf1c47fca4ec98ed599b113cd93db","duration_ms":0.79,"event":"request.handled","level":"info","ts":"2026-10-30T04:29:34.950067Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-10-30T04:29:36.079497Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-10-30T04:29:36.138465Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-10-30T04:29:36.188615Z"}
|
||||
{"event":"Finished server process [20]","level":"info","ts":"2026-10-30T04:29:36.188874Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-10-30T04:29:36.247500Z"}
|
||||
{"event":"Finished server process [19]","level":"info","ts":"2026-10-30T04:29:36.247910Z"}
|
||||
{"event":"Worker (pid:20) was sent SIGTERM!","level":"info","ts":"2026-10-30T04:29:36.250957Z"}
|
||||
{"event":"Worker (pid:19) was sent SIGTERM!","level":"info","ts":"2026-10-30T04:29:36.357386Z"}
|
||||
{"event":"Shutting down: Master","level":"info","ts":"2026-10-30T04:29:36.468491Z"}
|
||||
$ scripts/restore.sh
|
||||
Container mtusi2026lab4-api-2 Running
|
||||
Container mtusi2026lab4-api-1 Starting
|
||||
Container mtusi2026lab4-api-1 Started
|
||||
Container mtusi2026lab4-api-2 Waiting
|
||||
Container mtusi2026lab4-api-1 Waiting
|
||||
Container mtusi2026lab4-api-2 Healthy
|
||||
Container mtusi2026lab4-api-1 Healthy
|
||||
== after restore
|
||||
0cc3ee358e59 running started=2026-10-30T04:29:49.45750296Z finished=2026-10-30T04:29:36.57527926Z
|
||||
899a952a5a21 running started=2026-10-30T04:29:31.104320507Z finished=2026-10-30T04:29:18.153900709Z
|
||||
@@ -1,39 +0,0 @@
|
||||
date: 2026-10-30T04:29:14Z commit: 81dd816
|
||||
== before: api replicas (hostname = X-Instance-Id), state, StartedAt, FinishedAt
|
||||
0cc3ee358e59 running started=2026-10-30T04:28:59.851144131Z finished=0001-01-01T00:00:00Z
|
||||
899a952a5a21 running started=2026-10-30T04:29:11.286693179Z finished=2026-10-30T04:29:11.040183429Z
|
||||
$ 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": 129, "failed_attempts": 0, "first_recovery_seconds": 2.885}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
== after: api replicas
|
||||
0cc3ee358e59 running started=2026-10-30T04:28:59.851144131Z finished=0001-01-01T00:00:00Z
|
||||
899a952a5a21 exited started=2026-10-30T04:29:11.286693179Z finished=2026-10-30T04:29:18.153900709Z
|
||||
== stopped replica: 899a952a5a21; shutdown: signal, drain window with readiness 503, close, exit
|
||||
{"event":"Handling signal: term","level":"info","ts":"2026-10-30T04:29:15.605798Z"}
|
||||
{"limit":2.0,"event":"service.draining","level":"info","ts":"2026-10-30T04:29:15.638898Z"}
|
||||
{"limit":2.0,"event":"service.draining","level":"info","ts":"2026-10-30T04:29:15.701830Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"b416afb071ad426a9dde141e952d697f","duration_ms":0.823,"event":"request.handled","level":"info","ts":"2026-10-30T04:29:16.528606Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"3fe4a4c39cb24a219d3a393a1c0332f0","duration_ms":1.591,"event":"request.handled","level":"info","ts":"2026-10-30T04:29:17.038813Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"152273913ad34012bf5eaf31432490ae","duration_ms":0.263,"event":"request.handled","level":"info","ts":"2026-10-30T04:29:17.388797Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-10-30T04:29:17.642635Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-10-30T04:29:17.714902Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-10-30T04:29:17.757838Z"}
|
||||
{"event":"Finished server process [20]","level":"info","ts":"2026-10-30T04:29:17.758374Z"}
|
||||
{"event":"Worker (pid:20) was sent SIGTERM!","level":"info","ts":"2026-10-30T04:29:17.826021Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-10-30T04:29:17.832655Z"}
|
||||
{"event":"Finished server process [13]","level":"info","ts":"2026-10-30T04:29:17.833005Z"}
|
||||
{"event":"Worker (pid:13) was sent SIGTERM!","level":"info","ts":"2026-10-30T04:29:17.927620Z"}
|
||||
{"event":"Shutting down: Master","level":"info","ts":"2026-10-30T04:29:18.029723Z"}
|
||||
$ scripts/restore.sh
|
||||
Container mtusi2026lab4-api-1 Running
|
||||
Container mtusi2026lab4-api-2 Starting
|
||||
Container mtusi2026lab4-api-2 Started
|
||||
Container mtusi2026lab4-api-2 Waiting
|
||||
Container mtusi2026lab4-api-1 Waiting
|
||||
Container mtusi2026lab4-api-2 Healthy
|
||||
Container mtusi2026lab4-api-1 Healthy
|
||||
== after restore
|
||||
0cc3ee358e59 running started=2026-10-30T04:28:59.851144131Z finished=0001-01-01T00:00:00Z
|
||||
899a952a5a21 running started=2026-10-30T04:29:31.104320507Z finished=2026-10-30T04:29:18.153900709Z
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"ok": true,
|
||||
"scenario": "failover-upload",
|
||||
"upload_instance": "899a952a5a21",
|
||||
"download_instance": "0cc3ee358e59",
|
||||
"sha256_equal": true,
|
||||
"hook_seconds": 2.72,
|
||||
"download_ok_after_seconds": 2.73,
|
||||
"restored": true
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
date: 2026-10-30T04:31:11Z commit: 81dd816
|
||||
$ make test-faults
|
||||
BASE_URL="http://127.0.0.1:18084" .venv/bin/pytest -m stack -v -s student-tests/stack
|
||||
============================= test session starts ==============================
|
||||
platform darwin -- Python 3.14.5, pytest-9.1.1, pluggy-1.6.0 -- <repo>/.venv/bin/python
|
||||
cachedir: .pytest_cache
|
||||
rootdir: <repo>
|
||||
configfile: pyproject.toml
|
||||
plugins: asyncio-1.4.0, anyio-4.15.1
|
||||
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
|
||||
collecting ... collected 17 items
|
||||
|
||||
student-tests/stack/test_attachment_faults.py::test_user_errors_never_become_500 10 MiB + 1 с Content-Length, тело не отправлено: 413
|
||||
10 MiB + 1 chunked: 413
|
||||
PNG 100000×100000 (бомба): 413
|
||||
PNG 8001×5000: 413
|
||||
обрезанный PNG: 415
|
||||
обрезанный JPEG: 415
|
||||
JPEG как image/png: 415
|
||||
GIF как image/png: 415
|
||||
WebP как image/png: 415
|
||||
текст как image/png: 415
|
||||
PNG как image/jpeg: 415
|
||||
пустое тело: 415
|
||||
application/octet-stream: 415
|
||||
без Content-Type: 415
|
||||
filename='../a.png': 400
|
||||
filename='a/b.png': 400
|
||||
filename='a\\b.png': 400
|
||||
filename='a\x00.png': 400
|
||||
filename='a\x01.png': 400
|
||||
filename='a\x7f.png': 400
|
||||
filename='': 400
|
||||
filename=' ': 400
|
||||
filename='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: 400
|
||||
filename=None: 400
|
||||
посторонний: upload в чужой чат: 404
|
||||
посторонний: метаданные: 404
|
||||
посторонний: /content: 404
|
||||
посторонний: ссылка на чужое вложение: 404
|
||||
вложение другого чата: 404
|
||||
неизвестное вложение: 404
|
||||
11 вложений: 400
|
||||
повтор вложения: 400
|
||||
невалидный UUID: 400
|
||||
пустой текст без вложений: 400
|
||||
невалидный id вложения: 400
|
||||
variant=thumbnail: 400
|
||||
строк вложений в чате: 2 (= ответов 201); ответов в журнале реплик: 54, из них 5xx: 0
|
||||
PASSED
|
||||
student-tests/stack/test_attachment_faults.py::test_commit_failure_is_compensated_at_once отказ COMMIT после записи объекта: 503 unavailable
|
||||
сразу после ответа: строка нет, объект HEAD 404
|
||||
журнал: audit.attachment_discarded reason=compensation
|
||||
PASSED
|
||||
student-tests/stack/test_attachment_faults.py::test_crash_between_put_and_commit_is_swept_after_grace реплика 899a952a5a21 убита между PUT и COMMIT, клиент получил 502
|
||||
реплика 0cc3ee358e59 убита между PUT и COMMIT, клиент получил 502
|
||||
остаток после падения: строка pending, объект HEAD 200
|
||||
остаток после падения: строка pending, объект HEAD 200
|
||||
старше grace: строка убрана через 26.2 с, объект HEAD 404
|
||||
моложе grace: строка pending, объект HEAD 200
|
||||
тот же после сдвига: убран через 1.0 с, объект HEAD 404
|
||||
готовое вложение в сообщении со сдвинутым created_at скачивается, SHA-256 совпадает
|
||||
PASSED
|
||||
student-tests/stack/test_attachment_faults.py::test_aborted_upload_leaves_nothing обрыв после 256 KiB из 5 MiB: статус в журнале реплики [400], намерение None
|
||||
PASSED
|
||||
student-tests/stack/test_attachment_faults.py::test_stalled_upload_is_cut_and_leaves_nothing тело зависло после 1 KiB: 503 unavailable за 8.01 с
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_registration_race_yields_exactly_one_user гонка 50 регистраций: 201×1, 409×49
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_chat_creation_rolls_back_on_unknown_member чат с несуществующим участником: 400 invalid_request
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_wrong_password_and_unknown_user_get_same_basic_challenge неверный пароль: 401 за 0.011 с
|
||||
неизвестный пользователь: 401 за 0.011 с
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_logout_then_token_is_dead logout: 204, затем 401, повтор 401
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_valkey_serves_repeated_checks 5 проверок токена: keyspace_hits 119 → 124
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_valkey_stopped_is_bypassed_but_logout_waits valkey остановлен, действующий токен: 200 за 0.004 с
|
||||
valkey остановлен, неизвестный токен: 401 за 0.003 с
|
||||
valkey остановлен: ready 200, вход 201, выход 503
|
||||
valkey снова запущен: повторный выход 204
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_valkey_restart_keeps_cache_and_revocations рестарт valkey: ключей 45 → 45
|
||||
рестарт valkey: живой 200, отозванный 401
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_valkey_flushall_loses_nothing FLUSHALL: живой 200, отозванный 401
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_postgres_stopped_gives_bounded_503_and_recovers postgres остановлен, ready: 503 за 0.004 с
|
||||
postgres остановлен, me: 503 за 0.003 с
|
||||
postgres остановлен, stranger: 503 за 0.002 с
|
||||
postgres остановлен, login: 503 за 0.002 с
|
||||
postgres остановлен, register: 503 за 0.015 с
|
||||
live внутри реплики 200; LB исключил все реплики ещё через 1.16 с
|
||||
live через LB без реплик: 503 за 0.000 с
|
||||
postgres запущен: готовность через 1.6 с, прежний токен 200
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_api_restart_keeps_session_without_extending_it рестарт api: готовность через 2.3 с, токен 200
|
||||
expires_at при входе 2026-10-30T05:32:12.249834Z, в БД после рестарта 2026-10-30T05:32:12.249834Z
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_full_restart_keeps_session_until_logout restart.sh: готовность через 0.0 с, прежний токен 200, выход 204, затем 401
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_session_expires_after_restart_at_original_time срок сессии сокращён до 20 с, рестарт api: готовность через 3.1 с, до срока 200, после срока 401
|
||||
PASSED
|
||||
|
||||
======================== 17 passed in 98.43s (0:01:38) =========================
|
||||
@@ -1,43 +0,0 @@
|
||||
date: 2026-11-06T09:10:22Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ sh scripts/failover-evidence.sh http://127.0.0.1:18084
|
||||
date: 2026-11-06T09:10:22Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
== before: api replicas (hostname = X-Instance-Id), state, StartedAt, FinishedAt
|
||||
d4c8d53d7433 running started=2026-11-06T09:10:18.309662551Z finished=2026-11-06T09:10:12.020503506Z
|
||||
da922ab2ea09 running started=2026-11-06T09:10:18.377623592Z finished=2026-11-06T09:10:12.004100798Z
|
||||
$ 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": 130, "failed_attempts": 0, "first_recovery_seconds": 2.883}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
== after: api replicas
|
||||
d4c8d53d7433 exited started=2026-11-06T09:10:18.309662551Z finished=2026-11-06T09:10:25.313223596Z
|
||||
da922ab2ea09 running started=2026-11-06T09:10:18.377623592Z finished=2026-11-06T09:10:12.004100798Z
|
||||
== stopped replica: d4c8d53d7433; shutdown: signal, drain window with readiness 503, close, exit
|
||||
{"event":"Handling signal: term","level":"info","ts":"2026-11-06T09:10:22.774795Z"}
|
||||
{"limit":2.0,"event":"service.draining","level":"info","ts":"2026-11-06T09:10:22.776559Z"}
|
||||
{"limit":2.0,"event":"service.draining","level":"info","ts":"2026-11-06T09:10:22.848442Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"c23539767f7c4ef5ba39f58a446754a2","duration_ms":1.481,"event":"request.handled","level":"info","ts":"2026-11-06T09:10:23.545632Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"60444a3eba784d839b8caccbaa24d1f2","duration_ms":0.278,"event":"request.handled","level":"info","ts":"2026-11-06T09:10:24.058530Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"5a247b2f9b304ff789354712b9c2d857","duration_ms":0.282,"event":"request.handled","level":"info","ts":"2026-11-06T09:10:24.545468Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-11-06T09:10:24.779511Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-11-06T09:10:24.852501Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-11-06T09:10:24.884399Z"}
|
||||
{"event":"Finished server process [19]","level":"info","ts":"2026-11-06T09:10:24.884667Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-11-06T09:10:24.959721Z"}
|
||||
{"event":"Finished server process [20]","level":"info","ts":"2026-11-06T09:10:24.959901Z"}
|
||||
{"event":"Worker (pid:19) was sent SIGTERM!","level":"info","ts":"2026-11-06T09:10:24.961675Z"}
|
||||
{"event":"Worker (pid:20) was sent SIGTERM!","level":"info","ts":"2026-11-06T09:10:25.072586Z"}
|
||||
{"event":"Shutting down: Master","level":"info","ts":"2026-11-06T09:10:25.178811Z"}
|
||||
$ scripts/restore.sh
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Running
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Healthy
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Healthy
|
||||
== after restore
|
||||
d4c8d53d7433 running started=2026-11-06T09:10:38.256484379Z finished=2026-11-06T09:10:25.313223596Z
|
||||
da922ab2ea09 running started=2026-11-06T09:10:18.377623592Z finished=2026-11-06T09:10:12.004100798Z
|
||||
exit_code: 0 elapsed_seconds: 19.912
|
||||
@@ -1,39 +0,0 @@
|
||||
date: 2026-11-06T09:10:22Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
== before: api replicas (hostname = X-Instance-Id), state, StartedAt, FinishedAt
|
||||
d4c8d53d7433 running started=2026-11-06T09:10:18.309662551Z finished=2026-11-06T09:10:12.020503506Z
|
||||
da922ab2ea09 running started=2026-11-06T09:10:18.377623592Z finished=2026-11-06T09:10:12.004100798Z
|
||||
$ 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": 130, "failed_attempts": 0, "first_recovery_seconds": 2.883}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
== after: api replicas
|
||||
d4c8d53d7433 exited started=2026-11-06T09:10:18.309662551Z finished=2026-11-06T09:10:25.313223596Z
|
||||
da922ab2ea09 running started=2026-11-06T09:10:18.377623592Z finished=2026-11-06T09:10:12.004100798Z
|
||||
== stopped replica: d4c8d53d7433; shutdown: signal, drain window with readiness 503, close, exit
|
||||
{"event":"Handling signal: term","level":"info","ts":"2026-11-06T09:10:22.774795Z"}
|
||||
{"limit":2.0,"event":"service.draining","level":"info","ts":"2026-11-06T09:10:22.776559Z"}
|
||||
{"limit":2.0,"event":"service.draining","level":"info","ts":"2026-11-06T09:10:22.848442Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"c23539767f7c4ef5ba39f58a446754a2","duration_ms":1.481,"event":"request.handled","level":"info","ts":"2026-11-06T09:10:23.545632Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"60444a3eba784d839b8caccbaa24d1f2","duration_ms":0.278,"event":"request.handled","level":"info","ts":"2026-11-06T09:10:24.058530Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"5a247b2f9b304ff789354712b9c2d857","duration_ms":0.282,"event":"request.handled","level":"info","ts":"2026-11-06T09:10:24.545468Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-11-06T09:10:24.779511Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-11-06T09:10:24.852501Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-11-06T09:10:24.884399Z"}
|
||||
{"event":"Finished server process [19]","level":"info","ts":"2026-11-06T09:10:24.884667Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-11-06T09:10:24.959721Z"}
|
||||
{"event":"Finished server process [20]","level":"info","ts":"2026-11-06T09:10:24.959901Z"}
|
||||
{"event":"Worker (pid:19) was sent SIGTERM!","level":"info","ts":"2026-11-06T09:10:24.961675Z"}
|
||||
{"event":"Worker (pid:20) was sent SIGTERM!","level":"info","ts":"2026-11-06T09:10:25.072586Z"}
|
||||
{"event":"Shutting down: Master","level":"info","ts":"2026-11-06T09:10:25.178811Z"}
|
||||
$ scripts/restore.sh
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Running
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Healthy
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Healthy
|
||||
== after restore
|
||||
d4c8d53d7433 running started=2026-11-06T09:10:38.256484379Z finished=2026-11-06T09:10:25.313223596Z
|
||||
da922ab2ea09 running started=2026-11-06T09:10:18.377623592Z finished=2026-11-06T09:10:12.004100798Z
|
||||
@@ -1,33 +0,0 @@
|
||||
date: 2026-11-06T09:13:29Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ python3 scripts/lab4_scenarios.py failover-upload --base-url http://127.0.0.1:18084 --output evidence/forward-final-2026-11-06/failover-upload.json
|
||||
{
|
||||
"ok": true,
|
||||
"date": "2026-11-06T09:13:29Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"scenario": "failover-upload",
|
||||
"upload_instance": "d4c8d53d7433",
|
||||
"download_instance": "da922ab2ea09",
|
||||
"sha256_equal": true,
|
||||
"hook_seconds": 2.734,
|
||||
"download_ok_after_seconds": 2.762,
|
||||
"replicas_at_download": [
|
||||
{
|
||||
"hostname": "d4c8d53d7433",
|
||||
"status": "exited",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:12:33.47280571Z",
|
||||
"finished_at": "2026-11-06T09:13:32.422358668Z"
|
||||
},
|
||||
{
|
||||
"hostname": "da922ab2ea09",
|
||||
"status": "running",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:12:33.439519377Z",
|
||||
"finished_at": "2026-11-06T09:12:33.358178252Z"
|
||||
}
|
||||
],
|
||||
"restored": false,
|
||||
"replicas_after_restore": null
|
||||
}
|
||||
exit_code: 0 elapsed_seconds: 3.177
|
||||
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"ok": true,
|
||||
"date": "2026-11-06T09:13:29Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"scenario": "failover-upload",
|
||||
"upload_instance": "d4c8d53d7433",
|
||||
"download_instance": "da922ab2ea09",
|
||||
"sha256_equal": true,
|
||||
"hook_seconds": 2.734,
|
||||
"download_ok_after_seconds": 2.762,
|
||||
"replicas_at_download": [
|
||||
{
|
||||
"hostname": "d4c8d53d7433",
|
||||
"status": "exited",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:12:33.47280571Z",
|
||||
"finished_at": "2026-11-06T09:13:32.422358668Z"
|
||||
},
|
||||
{
|
||||
"hostname": "da922ab2ea09",
|
||||
"status": "running",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:12:33.439519377Z",
|
||||
"finished_at": "2026-11-06T09:12:33.358178252Z"
|
||||
}
|
||||
],
|
||||
"restored": false,
|
||||
"replicas_after_restore": null
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
date: 2026-11-06T09:31:35Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {}
|
||||
$ sh -c 'make check && make validate && make lint && openspec validate --all --strict'
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
.venv/bin/ruff check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py
|
||||
All checks passed!
|
||||
.venv/bin/ruff format --check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py
|
||||
163 files already formatted
|
||||
.venv/bin/ty check src student-tests alembic
|
||||
All checks passed!
|
||||
- Validating...
|
||||
✓ change/forward-lab3-final-review-fixes
|
||||
✓ spec/lab1-event-publication
|
||||
✓ spec/lab1-messenger-chats
|
||||
✓ spec/lab1-messenger-history
|
||||
✓ spec/lab1-messenger-identity
|
||||
✓ spec/lab1-service-operability
|
||||
✓ spec/lab2-auth-sessions
|
||||
✓ spec/lab2-dependency-failures
|
||||
✓ spec/lab2-history-index
|
||||
✓ spec/lab2-persistent-storage
|
||||
✓ spec/lab2-session-cache
|
||||
✓ spec/lab3-failover-operations
|
||||
✓ spec/lab3-idempotent-messages
|
||||
✓ spec/lab3-load-balancing
|
||||
✓ spec/lab4-attachments
|
||||
✓ spec/lab4-evidence-runs
|
||||
✓ spec/lab4-object-storage
|
||||
✓ spec/lab4-storage-reconciler
|
||||
✓ spec/lab4-upload-resilience
|
||||
Totals: 19 passed, 0 failed (19 items)
|
||||
exit_code: 0 elapsed_seconds: 1.660
|
||||
@@ -1,6 +0,0 @@
|
||||
date: 2026-11-06T09:18:22Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ 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.
|
||||
exit_code: 0 elapsed_seconds: 0.435
|
||||
@@ -1,7 +0,0 @@
|
||||
[
|
||||
{
|
||||
"severity": "minor",
|
||||
"file": "src/messenger/messaging/entrypoints/schemas.py:35",
|
||||
"problem": "Непарный Unicode surrogate U+D800/U+DFFF в text принимается схемой, fingerprint вызывает PydanticSerializationError; реальный HTTP возвращает 500 internal_error. Воспроизведено на 75b93bbba5f29575d3fca1d013cc7e0770d88082: evidence/forward-final-2026-11-06/known-minor-http.txt. Сохранено без исправления по правилу minor."
|
||||
}
|
||||
]
|
||||
@@ -1,49 +0,0 @@
|
||||
date: 2026-11-06T09:30:40Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {}
|
||||
$ python3 -c 'import collections
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
source = Path("/Users/artemkostylev/projects/learning/HL/labs/.pipeline/.runs/labs/snapshots/lab3-ba78cf6da439a4ec60fd59389583b38285b0b2b1")
|
||||
manifest = json.loads(Path("evidence/forward-final-2026-11-06/source-manifest.json").read_text())
|
||||
def source_git(*args):
|
||||
return subprocess.check_output(["git", "-C", str(source), *args], text=True)
|
||||
assert source_git("rev-parse", "HEAD").strip() == manifest["source_to"]
|
||||
changed = dict(line.split("\t", 1)[::-1] for line in source_git("diff", "--name-status", manifest["source_from"], manifest["source_to"]).splitlines())
|
||||
assert changed == {row["file"]: row["status"] for row in manifest["files"]}
|
||||
blobs = {}
|
||||
for line in source_git("ls-tree", "-r", manifest["source_to"]).splitlines():
|
||||
meta, path = line.split("\t", 1)
|
||||
blobs[path] = meta.split()[2]
|
||||
merged = {"infra/haproxy/haproxy.cfg", "src/messenger/messaging/domain/values.py"}
|
||||
exact = 0
|
||||
for row in manifest["files"]:
|
||||
assert blobs[row["file"]] == row["source_blob"], row["file"]
|
||||
if row["action"] == "copied-source-archive" or (row["action"] == "ported" and row["file"] not in merged):
|
||||
assert Path(row["file"]).read_bytes() == (source / row["file"]).read_bytes(), row["file"]
|
||||
exact += 1
|
||||
print(json.dumps({"source_from":manifest["source_from"], "source_to":manifest["source_to"], "manifest_paths":len(changed), "decisions":dict(collections.Counter(row["action"] for row in manifest["files"])), "byte_exact_paths":exact, "manual_lab4_merges":sorted(merged)}, indent=2))
|
||||
subprocess.run(["git", "diff", "--exit-code", manifest["target_base"], "--", "contracts", "tests", "README.md", "COURSE.md"], check=True)
|
||||
subprocess.run(["git", "diff", "--exit-code", "75b93bbba5f29575d3fca1d013cc7e0770d88082", "--", "src", "student-tests", "infra", "scripts", "compose.yaml", "Dockerfile", "pyproject.toml", "uv.lock", "alembic"], check=True)
|
||||
print("PASS: complete immutable-source manifest, preserved normative files, runtime unchanged since measurements")
|
||||
'
|
||||
{
|
||||
"source_from": "f591fa64e525679a31c9db7f942d36c789e1a12f",
|
||||
"source_to": "ba78cf6da439a4ec60fd59389583b38285b0b2b1",
|
||||
"manifest_paths": 214,
|
||||
"decisions": {
|
||||
"adapted-context": 2,
|
||||
"not-copied": 169,
|
||||
"adapted-test-tool": 4,
|
||||
"ported": 14,
|
||||
"copied-source-archive": 19,
|
||||
"merged-via-local-change": 6
|
||||
},
|
||||
"byte_exact_paths": 31,
|
||||
"manual_lab4_merges": [
|
||||
"infra/haproxy/haproxy.cfg",
|
||||
"src/messenger/messaging/domain/values.py"
|
||||
]
|
||||
}
|
||||
PASS: complete immutable-source manifest, preserved normative files, runtime unchanged since measurements
|
||||
exit_code: 0 elapsed_seconds: 0.195
|
||||
@@ -1,48 +0,0 @@
|
||||
date: 2026-11-06T09:14:49Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:hlpipe-lab4-forward-final-20261106"}
|
||||
$ sh -c '
|
||||
set -e
|
||||
fixture_project=hlpipe-lab4-forward-lb-20261106
|
||||
fixture_file=student-tests/tools/lb_errors/compose.yaml
|
||||
trap '"'"'docker compose -p "$fixture_project" -f "$fixture_file" --profile probe down'"'"' EXIT
|
||||
docker compose -p "$fixture_project" -f "$fixture_file" up -d lb api
|
||||
docker compose -p "$fixture_project" -f "$fixture_file" run --rm --no-deps probe 502
|
||||
docker compose -p "$fixture_project" -f "$fixture_file" run --rm --no-deps probe 504
|
||||
docker compose -p "$fixture_project" -f "$fixture_file" stop api
|
||||
docker compose -p "$fixture_project" -f "$fixture_file" run --rm --no-deps probe 503
|
||||
'
|
||||
Network hlpipe-lab4-forward-lb-20261106_default Creating
|
||||
Network hlpipe-lab4-forward-lb-20261106_default Created
|
||||
Container hlpipe-lab4-forward-lb-20261106-lb-1 Creating
|
||||
Container hlpipe-lab4-forward-lb-20261106-api-1 Creating
|
||||
Container hlpipe-lab4-forward-lb-20261106-api-1 Created
|
||||
Container hlpipe-lab4-forward-lb-20261106-lb-1 Created
|
||||
Container hlpipe-lab4-forward-lb-20261106-api-1 Starting
|
||||
Container hlpipe-lab4-forward-lb-20261106-lb-1 Starting
|
||||
Container hlpipe-lab4-forward-lb-20261106-lb-1 Started
|
||||
Container hlpipe-lab4-forward-lb-20261106-api-1 Started
|
||||
{"status": 502, "request_id": "a\"b", "json_valid": true, "echo_matches": true, "seconds": 0.001}
|
||||
{"status": 502, "request_id": "a\\b", "json_valid": true, "echo_matches": true, "seconds": 0.001}
|
||||
{"status": 502, "request_id": "a\tb", "json_valid": true, "echo_matches": true, "seconds": 0.001}
|
||||
{"status": 502, "request_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "json_valid": true, "echo_matches": true, "seconds": 0.001}
|
||||
{"status": 504, "request_id": "a\"b", "json_valid": true, "echo_matches": true, "seconds": 10.024}
|
||||
{"status": 504, "request_id": "a\\b", "json_valid": true, "echo_matches": true, "seconds": 10.005}
|
||||
{"status": 504, "request_id": "a\tb", "json_valid": true, "echo_matches": true, "seconds": 10.022}
|
||||
{"status": 504, "request_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "json_valid": true, "echo_matches": true, "seconds": 10.007}
|
||||
Container hlpipe-lab4-forward-lb-20261106-api-1 Stopping
|
||||
Container hlpipe-lab4-forward-lb-20261106-api-1 Stopped
|
||||
{"status": 503, "request_id": "a\"b", "json_valid": true, "echo_matches": true, "seconds": 0.004}
|
||||
{"status": 503, "request_id": "a\\b", "json_valid": true, "echo_matches": true, "seconds": 0.0}
|
||||
{"status": 503, "request_id": "a\tb", "json_valid": true, "echo_matches": true, "seconds": 0.0}
|
||||
{"status": 503, "request_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "json_valid": true, "echo_matches": true, "seconds": 0.0}
|
||||
Container hlpipe-lab4-forward-lb-20261106-api-1 Stopping
|
||||
Container hlpipe-lab4-forward-lb-20261106-lb-1 Stopping
|
||||
Container hlpipe-lab4-forward-lb-20261106-api-1 Stopped
|
||||
Container hlpipe-lab4-forward-lb-20261106-api-1 Removing
|
||||
Container hlpipe-lab4-forward-lb-20261106-api-1 Removed
|
||||
Container hlpipe-lab4-forward-lb-20261106-lb-1 Stopped
|
||||
Container hlpipe-lab4-forward-lb-20261106-lb-1 Removing
|
||||
Container hlpipe-lab4-forward-lb-20261106-lb-1 Removed
|
||||
Network hlpipe-lab4-forward-lb-20261106_default Removing
|
||||
Network hlpipe-lab4-forward-lb-20261106_default Removed
|
||||
exit_code: 0 elapsed_seconds: 52.831
|
||||
@@ -1,24 +0,0 @@
|
||||
date: 2026-11-06T09:15:37Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {}
|
||||
$ python3 -c 'import base64,http.client,json,uuid
|
||||
conn=http.client.HTTPConnection("127.0.0.1",18084,timeout=10)
|
||||
name="surrogate_"+uuid.uuid4().hex[:12]
|
||||
password=uuid.uuid4().hex
|
||||
def request(method,path,body=None,headers=None):
|
||||
conn.request(method,path,None if body is None else json.dumps(body).encode(),{"Content-Type":"application/json",**(headers or {})})
|
||||
response=conn.getresponse()
|
||||
return response.status,json.loads(response.read() or "null")
|
||||
status,user=request("POST","/api/v1/users",{"username":name,"password":password,"display_name":"Synthetic"})
|
||||
assert status==201
|
||||
status,session=request("POST","/api/v1/auth/sessions",headers={"Authorization":"Basic "+base64.b64encode((name+":"+password).encode()).decode()})
|
||||
assert status==201
|
||||
headers={"Authorization":"Bearer "+session["token"]}
|
||||
status,chat=request("POST","/api/v1/chats",{"title":"Synthetic","member_ids":[user["id"]]},headers)
|
||||
assert status==201
|
||||
for value in [chr(0xd800),chr(0xdfff)]:
|
||||
status,data=request("POST","/api/v1/chats/"+chat["id"]+"/messages",{"text":value},{**headers,"Idempotency-Key":uuid.uuid4().hex})
|
||||
print(json.dumps({"codepoint":hex(ord(value)),"status":status,"error_code":data.get("error",{}).get("code")}))
|
||||
conn.close()'
|
||||
{"codepoint": "0xd800", "status": 500, "error_code": "internal_error"}
|
||||
{"codepoint": "0xdfff", "status": 500, "error_code": "internal_error"}
|
||||
exit_code: 0 elapsed_seconds: 0.114
|
||||
@@ -1,15 +0,0 @@
|
||||
date: 2026-11-06T09:09:38Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {}
|
||||
$ .venv/bin/python -c 'import json
|
||||
from messenger.messaging.entrypoints.schemas import CreateMessageRequest
|
||||
for value in [chr(0xd800), chr(0xdfff)]:
|
||||
body = CreateMessageRequest(text=value)
|
||||
try:
|
||||
body.fingerprint()
|
||||
result = "accepted"
|
||||
except Exception as error:
|
||||
result = type(error).__name__
|
||||
print(json.dumps({"codepoint": hex(ord(value)), "schema_accepted": True, "fingerprint_result": result}))'
|
||||
{"codepoint": "0xd800", "schema_accepted": true, "fingerprint_result": "PydanticSerializationError"}
|
||||
{"codepoint": "0xdfff", "schema_accepted": true, "fingerprint_result": "PydanticSerializationError"}
|
||||
exit_code: 0 elapsed_seconds: 0.124
|
||||
@@ -1,29 +0,0 @@
|
||||
date: 2026-11-06T09:13:49Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ python3 scripts/limits.py
|
||||
date: 2026-11-06T09:13:49Z commit: 75b93bb
|
||||
$ docker compose --profile bench --profile tools --profile reconcile config --format json (declared)
|
||||
service cpus/mem ports secrets volumes networks ro user
|
||||
---------- ---------- ------------------------------- ------------------------------------------------------------------------------------------------------------------------------- ---------- ---------------------- ----- -----------
|
||||
api 1/512MiB - cache_url,cursor_secret,database_url,s3_access_key_id,s3_secret_access_key - backend(internal) true image
|
||||
k6 2/512MiB - - - edge false image
|
||||
lb 1/128MiB 127.0.0.1:18084,127.0.0.1:24844 - - backend(internal),edge true image
|
||||
migrate 0.5/256MiB - database_url - backend(internal) false image
|
||||
postgres 2/1024MiB - postgres_password pgdata backend(internal) false 70:70
|
||||
reconciler 1/256MiB - database_url,s3_reconciler_access_key_id,s3_reconciler_secret_access_key - backend(internal) true image
|
||||
s3 1/512MiB - s3_root_password,s3_root_user s3data backend(internal) true image
|
||||
s3-cli 0.5/64MiB - s3_access_key_id,s3_reconciler_access_key_id,s3_reconciler_secret_access_key,s3_root_password,s3_root_user,s3_secret_access_key - backend(internal) true 65534:65534
|
||||
s3-init 0.5/64MiB - s3_access_key_id,s3_reconciler_access_key_id,s3_reconciler_secret_access_key,s3_root_password,s3_root_user,s3_secret_access_key - backend(internal) true 65534:65534
|
||||
valkey 0.5/128MiB - valkey.conf valkeydata backend(internal) false 999:1000
|
||||
|
||||
$ docker inspect (running containers: hostname = X-Instance-Id, applied limits)
|
||||
service hostname cpus memory published
|
||||
-------- ------------ ---- ------- ---------------------------------------------------
|
||||
api da922ab2ea09 1 512MiB
|
||||
lb ea6930f64089 1 128MiB 127.0.0.1:18084->8080/tcp,127.0.0.1:24844->8404/tcp
|
||||
postgres 3f3a870d89c0 2 1024MiB
|
||||
s3 5921e788f03d 1 512MiB
|
||||
valkey 07ea16e2fcfe 0.5 128MiB
|
||||
|
||||
PASS: limits, ports, secrets, volumes and networks match the policy
|
||||
exit_code: 0 elapsed_seconds: 0.308
|
||||
@@ -1,116 +0,0 @@
|
||||
date: 2026-11-06T09:16:16Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ make load-evidence
|
||||
sh scripts/load-evidence.sh
|
||||
date: 2026-11-06T09:16:17Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082 network: hlpipe-lab4-forward-final-20261106_edge
|
||||
# make load-evidence (scripts/load-evidence.sh): закрытый контур tests/load.py, 64 потока, 8 с, все записи
|
||||
# прогона в один новый чат, 3 повтора с паузой 15 с; клиент — одноразовый контейнер в сети <проект>_edge
|
||||
# стенда (2 CPU, 512 MiB, базовый образ API по digest, tests/, contracts/ и lab.json только для чтения,
|
||||
# tcp_tw_reuse=1), адрес http://lb:8080. На 4-й секунде — docker stats; после прогона — request.handled реплик.
|
||||
$ docker ps --format '{{.Names}}' | grep -v '^hlpipe-lab4-forward-final-20261106-' # чужие контейнеры на VM во время серии
|
||||
$ client() { docker run --rm --name hlpipe-lab4-forward-final-20261106-load-client --network hlpipe-lab4-forward-final-20261106_edge --cpus 2 --memory 512m --sysctl net.ipv4.tcp_tw_reuse=1 -v "$PWD/tests:/w/tests:ro" -v "$PWD/contracts:/w/contracts:ro" -v "$PWD/lab.json:/w/lab.json:ro" -v "$PWD/evidence/forward-final-2026-11-06/load:/out" python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d python /w/tests/load.py "$@"; }
|
||||
$ client --base-url http://lb:8080 --duration 8 --concurrency 64 --output /out/run1.json
|
||||
exit 0
|
||||
{
|
||||
"lab": 4,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 8.0,
|
||||
"elapsed_seconds": 8.238,
|
||||
"concurrency": 64,
|
||||
"successful_requests": 11768,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 1428.577,
|
||||
"successful_latency_ms": {
|
||||
"p50": 40.163,
|
||||
"p95": 100.062,
|
||||
"p99": 141.558
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
$ docker stats --no-stream # 4-я секунда прогона: контейнер CPU% память
|
||||
api-1 93.26% 271.2MiB / 512MiB
|
||||
api-2 89.65% 307.4MiB / 512MiB
|
||||
lb-1 46.78% 30.14MiB / 128MiB
|
||||
load-client 60.53% 83.66MiB / 512MiB
|
||||
postgres-1 157.07% 151.1MiB / 1GiB
|
||||
s3-1 0.76% 69.52MiB / 512MiB
|
||||
valkey-1 3.81% 13.9MiB / 128MiB
|
||||
$ docker compose logs --since 2026-11-06T09:16:17Z api | request.handled: статус метод маршрут число
|
||||
200 GET /health/live 1
|
||||
200 GET /health/ready 22
|
||||
201 POST /api/v1/auth/sessions 3
|
||||
201 POST /api/v1/chats 1
|
||||
201 POST /api/v1/chats/{chat_id}/messages 11768
|
||||
201 POST /api/v1/users 3
|
||||
$ client --base-url http://lb:8080 --duration 8 --concurrency 64 --output /out/run2.json
|
||||
exit 0
|
||||
{
|
||||
"lab": 4,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 8.0,
|
||||
"elapsed_seconds": 8.229,
|
||||
"concurrency": 64,
|
||||
"successful_requests": 11984,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 1456.338,
|
||||
"successful_latency_ms": {
|
||||
"p50": 37.442,
|
||||
"p95": 98.948,
|
||||
"p99": 134.678
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
$ docker stats --no-stream # 4-я секунда прогона: контейнер CPU% память
|
||||
api-1 90.89% 272.5MiB / 512MiB
|
||||
api-2 75.30% 310.1MiB / 512MiB
|
||||
lb-1 39.94% 30.58MiB / 128MiB
|
||||
load-client 46.50% 83.65MiB / 512MiB
|
||||
postgres-1 121.64% 158.2MiB / 1GiB
|
||||
s3-1 0.77% 69.37MiB / 512MiB
|
||||
valkey-1 3.02% 13.87MiB / 128MiB
|
||||
$ docker compose logs --since 2026-11-06T09:16:41Z api | request.handled: статус метод маршрут число
|
||||
200 GET /health/live 1
|
||||
200 GET /health/ready 23
|
||||
201 POST /api/v1/auth/sessions 3
|
||||
201 POST /api/v1/chats 1
|
||||
201 POST /api/v1/chats/{chat_id}/messages 11984
|
||||
201 POST /api/v1/users 3
|
||||
$ client --base-url http://lb:8080 --duration 8 --concurrency 64 --output /out/run3.json
|
||||
exit 0
|
||||
{
|
||||
"lab": 4,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 8.0,
|
||||
"elapsed_seconds": 8.21,
|
||||
"concurrency": 64,
|
||||
"successful_requests": 12555,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 1529.32,
|
||||
"successful_latency_ms": {
|
||||
"p50": 33.478,
|
||||
"p95": 98.475,
|
||||
"p99": 138.028
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
$ docker stats --no-stream # 4-я секунда прогона: контейнер CPU% память
|
||||
api-1 100.60% 273.6MiB / 512MiB
|
||||
api-2 99.12% 310.2MiB / 512MiB
|
||||
lb-1 58.14% 30.39MiB / 128MiB
|
||||
load-client 66.66% 83.66MiB / 512MiB
|
||||
postgres-1 168.89% 167.2MiB / 1GiB
|
||||
s3-1 0.80% 71.19MiB / 512MiB
|
||||
valkey-1 4.31% 13.5MiB / 128MiB
|
||||
$ docker compose logs --since 2026-11-06T09:17:05Z api | request.handled: статус метод маршрут число
|
||||
200 GET /health/live 1
|
||||
200 GET /health/ready 24
|
||||
201 POST /api/v1/auth/sessions 3
|
||||
201 POST /api/v1/chats 1
|
||||
201 POST /api/v1/chats/{chat_id}/messages 12555
|
||||
201 POST /api/v1/users 3
|
||||
$ docker compose exec -T postgres psql -c 'SELECT count(*) FROM messages'
|
||||
36448
|
||||
exit_code: 0 elapsed_seconds: 57.764
|
||||
@@ -1,111 +0,0 @@
|
||||
date: 2026-11-06T09:16:17Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082 network: hlpipe-lab4-forward-final-20261106_edge
|
||||
# make load-evidence (scripts/load-evidence.sh): закрытый контур tests/load.py, 64 потока, 8 с, все записи
|
||||
# прогона в один новый чат, 3 повтора с паузой 15 с; клиент — одноразовый контейнер в сети <проект>_edge
|
||||
# стенда (2 CPU, 512 MiB, базовый образ API по digest, tests/, contracts/ и lab.json только для чтения,
|
||||
# tcp_tw_reuse=1), адрес http://lb:8080. На 4-й секунде — docker stats; после прогона — request.handled реплик.
|
||||
$ docker ps --format '{{.Names}}' | grep -v '^hlpipe-lab4-forward-final-20261106-' # чужие контейнеры на VM во время серии
|
||||
$ client() { docker run --rm --name hlpipe-lab4-forward-final-20261106-load-client --network hlpipe-lab4-forward-final-20261106_edge --cpus 2 --memory 512m --sysctl net.ipv4.tcp_tw_reuse=1 -v "$PWD/tests:/w/tests:ro" -v "$PWD/contracts:/w/contracts:ro" -v "$PWD/lab.json:/w/lab.json:ro" -v "$PWD/evidence/forward-final-2026-11-06/load:/out" python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d python /w/tests/load.py "$@"; }
|
||||
$ client --base-url http://lb:8080 --duration 8 --concurrency 64 --output /out/run1.json
|
||||
exit 0
|
||||
{
|
||||
"lab": 4,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 8.0,
|
||||
"elapsed_seconds": 8.238,
|
||||
"concurrency": 64,
|
||||
"successful_requests": 11768,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 1428.577,
|
||||
"successful_latency_ms": {
|
||||
"p50": 40.163,
|
||||
"p95": 100.062,
|
||||
"p99": 141.558
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
$ docker stats --no-stream # 4-я секунда прогона: контейнер CPU% память
|
||||
api-1 93.26% 271.2MiB / 512MiB
|
||||
api-2 89.65% 307.4MiB / 512MiB
|
||||
lb-1 46.78% 30.14MiB / 128MiB
|
||||
load-client 60.53% 83.66MiB / 512MiB
|
||||
postgres-1 157.07% 151.1MiB / 1GiB
|
||||
s3-1 0.76% 69.52MiB / 512MiB
|
||||
valkey-1 3.81% 13.9MiB / 128MiB
|
||||
$ docker compose logs --since 2026-11-06T09:16:17Z api | request.handled: статус метод маршрут число
|
||||
200 GET /health/live 1
|
||||
200 GET /health/ready 22
|
||||
201 POST /api/v1/auth/sessions 3
|
||||
201 POST /api/v1/chats 1
|
||||
201 POST /api/v1/chats/{chat_id}/messages 11768
|
||||
201 POST /api/v1/users 3
|
||||
$ client --base-url http://lb:8080 --duration 8 --concurrency 64 --output /out/run2.json
|
||||
exit 0
|
||||
{
|
||||
"lab": 4,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 8.0,
|
||||
"elapsed_seconds": 8.229,
|
||||
"concurrency": 64,
|
||||
"successful_requests": 11984,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 1456.338,
|
||||
"successful_latency_ms": {
|
||||
"p50": 37.442,
|
||||
"p95": 98.948,
|
||||
"p99": 134.678
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
$ docker stats --no-stream # 4-я секунда прогона: контейнер CPU% память
|
||||
api-1 90.89% 272.5MiB / 512MiB
|
||||
api-2 75.30% 310.1MiB / 512MiB
|
||||
lb-1 39.94% 30.58MiB / 128MiB
|
||||
load-client 46.50% 83.65MiB / 512MiB
|
||||
postgres-1 121.64% 158.2MiB / 1GiB
|
||||
s3-1 0.77% 69.37MiB / 512MiB
|
||||
valkey-1 3.02% 13.87MiB / 128MiB
|
||||
$ docker compose logs --since 2026-11-06T09:16:41Z api | request.handled: статус метод маршрут число
|
||||
200 GET /health/live 1
|
||||
200 GET /health/ready 23
|
||||
201 POST /api/v1/auth/sessions 3
|
||||
201 POST /api/v1/chats 1
|
||||
201 POST /api/v1/chats/{chat_id}/messages 11984
|
||||
201 POST /api/v1/users 3
|
||||
$ client --base-url http://lb:8080 --duration 8 --concurrency 64 --output /out/run3.json
|
||||
exit 0
|
||||
{
|
||||
"lab": 4,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 8.0,
|
||||
"elapsed_seconds": 8.21,
|
||||
"concurrency": 64,
|
||||
"successful_requests": 12555,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 1529.32,
|
||||
"successful_latency_ms": {
|
||||
"p50": 33.478,
|
||||
"p95": 98.475,
|
||||
"p99": 138.028
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
$ docker stats --no-stream # 4-я секунда прогона: контейнер CPU% память
|
||||
api-1 100.60% 273.6MiB / 512MiB
|
||||
api-2 99.12% 310.2MiB / 512MiB
|
||||
lb-1 58.14% 30.39MiB / 128MiB
|
||||
load-client 66.66% 83.66MiB / 512MiB
|
||||
postgres-1 168.89% 167.2MiB / 1GiB
|
||||
s3-1 0.80% 71.19MiB / 512MiB
|
||||
valkey-1 4.31% 13.5MiB / 128MiB
|
||||
$ docker compose logs --since 2026-11-06T09:17:05Z api | request.handled: статус метод маршрут число
|
||||
200 GET /health/live 1
|
||||
200 GET /health/ready 24
|
||||
201 POST /api/v1/auth/sessions 3
|
||||
201 POST /api/v1/chats 1
|
||||
201 POST /api/v1/chats/{chat_id}/messages 12555
|
||||
201 POST /api/v1/users 3
|
||||
$ docker compose exec -T postgres psql -c 'SELECT count(*) FROM messages'
|
||||
36448
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"lab": 4,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 8.0,
|
||||
"elapsed_seconds": 8.238,
|
||||
"concurrency": 64,
|
||||
"successful_requests": 11768,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 1428.577,
|
||||
"successful_latency_ms": {
|
||||
"p50": 40.163,
|
||||
"p95": 100.062,
|
||||
"p99": 141.558
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"lab": 4,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 8.0,
|
||||
"elapsed_seconds": 8.229,
|
||||
"concurrency": 64,
|
||||
"successful_requests": 11984,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 1456.338,
|
||||
"successful_latency_ms": {
|
||||
"p50": 37.442,
|
||||
"p95": 98.948,
|
||||
"p99": 134.678
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"lab": 4,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 8.0,
|
||||
"elapsed_seconds": 8.21,
|
||||
"concurrency": 64,
|
||||
"successful_requests": 12555,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 1529.32,
|
||||
"successful_latency_ms": {
|
||||
"p50": 33.478,
|
||||
"p95": 98.475,
|
||||
"p99": 138.028
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
date: 2026-11-06T09:18:23Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ make down
|
||||
docker compose --profile bench --profile tools --profile reconcile down
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Stopping
|
||||
Container hlpipe-lab4-forward-final-20261106-lb-1 Stopping
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Stopping
|
||||
Container hlpipe-lab4-forward-final-20261106-lb-1 Stopped
|
||||
Container hlpipe-lab4-forward-final-20261106-lb-1 Removing
|
||||
Container hlpipe-lab4-forward-final-20261106-lb-1 Removed
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Stopped
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Removing
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Removed
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Stopped
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Removing
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Removed
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Stopping
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Stopping
|
||||
Container hlpipe-lab4-forward-final-20261106-valkey-1 Stopping
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Stopped
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Removing
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Stopped
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Removing
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Removed
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Stopping
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Removed
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Stopping
|
||||
Container hlpipe-lab4-forward-final-20261106-valkey-1 Stopped
|
||||
Container hlpipe-lab4-forward-final-20261106-valkey-1 Removing
|
||||
Container hlpipe-lab4-forward-final-20261106-valkey-1 Removed
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Stopped
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Removing
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Stopped
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Removing
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Removed
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Removed
|
||||
Network hlpipe-lab4-forward-final-20261106_edge Removing
|
||||
Network hlpipe-lab4-forward-final-20261106_backend Removing
|
||||
Network hlpipe-lab4-forward-final-20261106_edge Removed
|
||||
Network hlpipe-lab4-forward-final-20261106_backend Removed
|
||||
exit_code: 0 elapsed_seconds: 3.283
|
||||
@@ -1,72 +0,0 @@
|
||||
{
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"load_rps": {
|
||||
"all": [
|
||||
1428.577,
|
||||
1456.338,
|
||||
1529.32
|
||||
],
|
||||
"median": 1456.338,
|
||||
"min": 1428.577,
|
||||
"max": 1529.32
|
||||
},
|
||||
"load_p95_ms": {
|
||||
"all": [
|
||||
100.062,
|
||||
98.948,
|
||||
98.475
|
||||
],
|
||||
"median": 98.948,
|
||||
"min": 98.475,
|
||||
"max": 100.062
|
||||
},
|
||||
"load_failed": 0,
|
||||
"memory_statuses": [
|
||||
{
|
||||
"201": 80
|
||||
},
|
||||
{
|
||||
"201": 80
|
||||
},
|
||||
{
|
||||
"201": 78,
|
||||
"503": 2
|
||||
}
|
||||
],
|
||||
"body_bytes": [
|
||||
10485256,
|
||||
10485256,
|
||||
10485256
|
||||
],
|
||||
"api_peak_mib": {
|
||||
"all": [
|
||||
456.2,
|
||||
438.1,
|
||||
450.4
|
||||
],
|
||||
"median": 450.4,
|
||||
"min": 438.1,
|
||||
"max": 456.2
|
||||
},
|
||||
"lb_peak_mib": {
|
||||
"all": [
|
||||
31.8,
|
||||
28.5,
|
||||
29.1
|
||||
],
|
||||
"median": 29.1,
|
||||
"min": 28.5,
|
||||
"max": 31.8
|
||||
},
|
||||
"upload_p95_ms": {
|
||||
"all": [
|
||||
3641.3,
|
||||
4755.0,
|
||||
8091.8
|
||||
],
|
||||
"median": 4755.0,
|
||||
"min": 3641.3,
|
||||
"max": 8091.8
|
||||
},
|
||||
"oom": 0
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
date: 2026-11-06T09:21:03Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {}
|
||||
$ python3 -c 'import json,statistics,subprocess
|
||||
from pathlib import Path
|
||||
root=Path("evidence/forward-final-2026-11-06")
|
||||
loads=[json.loads(p.read_text()) for p in sorted((root/"load").glob("run*.json"))]
|
||||
memory=[json.loads(p.read_text()) for p in sorted((root/"memory").glob("run*/slots*.json"))]
|
||||
assert len(loads)==len(memory)==3
|
||||
assert all(r["failed_requests"]==0 for r in loads)
|
||||
assert all(r["count"]==80 and r["concurrency"]==40 and r["upload_concurrency"]==3 for r in memory)
|
||||
def stats(values):return {"all":values,"median":statistics.median(values),"min":min(values),"max":max(values)}
|
||||
result={"commit":subprocess.check_output(["git","rev-parse","HEAD"],text=True).strip(),"load_rps":stats([r["successful_rps"] for r in loads]),"load_p95_ms":stats([r["successful_latency_ms"]["p95"] for r in loads]),"load_failed":sum(r["failed_requests"] for r in loads),"memory_statuses":[r["status_codes"] for r in memory],"body_bytes":[r["body_bytes"] for r in memory],"api_peak_mib":stats([max(v["cgroup_memory_peak_mib"] for v in r["memory"].values()) for r in memory]),"lb_peak_mib":stats([r["lb"]["cgroup_memory_peak_mib"] for r in memory]),"upload_p95_ms":stats([r["latency_ms"]["p95"] for r in memory]),"oom":sum(sum(v["oom_kill"] for v in r["memory"].values())+r["lb"]["oom_kill"] for r in memory)}
|
||||
with (root/"measurement-summary.json").open("x") as stream:json.dump(result,stream,indent=2);stream.write("\n")
|
||||
print(json.dumps(result,indent=2))'
|
||||
{
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"load_rps": {
|
||||
"all": [
|
||||
1428.577,
|
||||
1456.338,
|
||||
1529.32
|
||||
],
|
||||
"median": 1456.338,
|
||||
"min": 1428.577,
|
||||
"max": 1529.32
|
||||
},
|
||||
"load_p95_ms": {
|
||||
"all": [
|
||||
100.062,
|
||||
98.948,
|
||||
98.475
|
||||
],
|
||||
"median": 98.948,
|
||||
"min": 98.475,
|
||||
"max": 100.062
|
||||
},
|
||||
"load_failed": 0,
|
||||
"memory_statuses": [
|
||||
{
|
||||
"201": 80
|
||||
},
|
||||
{
|
||||
"201": 80
|
||||
},
|
||||
{
|
||||
"201": 78,
|
||||
"503": 2
|
||||
}
|
||||
],
|
||||
"body_bytes": [
|
||||
10485256,
|
||||
10485256,
|
||||
10485256
|
||||
],
|
||||
"api_peak_mib": {
|
||||
"all": [
|
||||
456.2,
|
||||
438.1,
|
||||
450.4
|
||||
],
|
||||
"median": 450.4,
|
||||
"min": 438.1,
|
||||
"max": 456.2
|
||||
},
|
||||
"lb_peak_mib": {
|
||||
"all": [
|
||||
31.8,
|
||||
28.5,
|
||||
29.1
|
||||
],
|
||||
"median": 29.1,
|
||||
"min": 28.5,
|
||||
"max": 31.8
|
||||
},
|
||||
"upload_p95_ms": {
|
||||
"all": [
|
||||
3641.3,
|
||||
4755.0,
|
||||
8091.8
|
||||
],
|
||||
"median": 4755.0,
|
||||
"min": 3641.3,
|
||||
"max": 8091.8
|
||||
},
|
||||
"oom": 0
|
||||
}
|
||||
exit_code: 0 elapsed_seconds: 0.048
|
||||
@@ -1,7 +0,0 @@
|
||||
date: 2026-11-06T09:17:14Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ python3 scripts/upload_memory.py --base-url http://127.0.0.1:18084 --slots 3 --sizes 10485760 --levels 40 --out evidence/forward-final-2026-11-06/memory/run1
|
||||
# 2026-11-06T09:17:14Z commit 75b93bbba5f29575d3fca1d013cc7e0770d88082; api x2: 1 CPU, 512 MiB, 2 workers; MALLOC_MMAP_THRESHOLD_=131072; 2 uploads per client; peaks from cgroup memory.peak, MiB
|
||||
slots size conc codes p50_ms p95_ms api_idle api_peak api_oom lb_peak lb_oom
|
||||
3 10.0M 40 201x80 2587.5 3641.3 233.2 456.2 0 31.8 0
|
||||
exit_code: 0 elapsed_seconds: 20.084
|
||||
@@ -1,7 +0,0 @@
|
||||
date: 2026-11-06T09:17:34Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ python3 scripts/upload_memory.py --base-url http://127.0.0.1:18084 --slots 3 --sizes 10485760 --levels 40 --out evidence/forward-final-2026-11-06/memory/run2
|
||||
# 2026-11-06T09:17:34Z commit 75b93bbba5f29575d3fca1d013cc7e0770d88082; api x2: 1 CPU, 512 MiB, 2 workers; MALLOC_MMAP_THRESHOLD_=131072; 2 uploads per client; peaks from cgroup memory.peak, MiB
|
||||
slots size conc codes p50_ms p95_ms api_idle api_peak api_oom lb_peak lb_oom
|
||||
3 10.0M 40 201x80 2770.4 4755.0 231.3 438.1 0 28.5 0
|
||||
exit_code: 0 elapsed_seconds: 21.500
|
||||
@@ -1,7 +0,0 @@
|
||||
date: 2026-11-06T09:17:56Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ python3 scripts/upload_memory.py --base-url http://127.0.0.1:18084 --slots 3 --sizes 10485760 --levels 40 --out evidence/forward-final-2026-11-06/memory/run3
|
||||
# 2026-11-06T09:17:56Z commit 75b93bbba5f29575d3fca1d013cc7e0770d88082; api x2: 1 CPU, 512 MiB, 2 workers; MALLOC_MMAP_THRESHOLD_=131072; 2 uploads per client; peaks from cgroup memory.peak, MiB
|
||||
slots size conc codes p50_ms p95_ms api_idle api_peak api_oom lb_peak lb_oom
|
||||
3 10.0M 40 201x78,503x2 3560.9 8091.8 231.7 450.4 0 29.1 0
|
||||
exit_code: 0 elapsed_seconds: 23.514
|
||||
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:17:21Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"upload_concurrency": 3,
|
||||
"mode": "http",
|
||||
"count": 80,
|
||||
"concurrency": 40,
|
||||
"body_bytes": 10485256,
|
||||
"status_codes": {
|
||||
"201": 80
|
||||
},
|
||||
"instances": 2,
|
||||
"linked_in_messages": 0,
|
||||
"elapsed_seconds": 6.143,
|
||||
"successful_rps": 13.02,
|
||||
"latency_ms": {
|
||||
"p50": 2587.5,
|
||||
"p95": 3641.3,
|
||||
"p99": 4322.0,
|
||||
"max": 4322.0
|
||||
},
|
||||
"memory": {
|
||||
"35b198e7b5ca": {
|
||||
"idle_mib": 230.7,
|
||||
"docker_stats_peak_mib": 409.6,
|
||||
"cgroup_memory_peak_mib": 424.4,
|
||||
"oom_kill": 0
|
||||
},
|
||||
"93b12ae1c127": {
|
||||
"idle_mib": 233.2,
|
||||
"docker_stats_peak_mib": 419.5,
|
||||
"cgroup_memory_peak_mib": 456.2,
|
||||
"oom_kill": 0
|
||||
}
|
||||
},
|
||||
"lb": {
|
||||
"cgroup_memory_peak_mib": 31.8,
|
||||
"oom_kill": 0
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
# 2026-11-06T09:17:14Z commit 75b93bbba5f29575d3fca1d013cc7e0770d88082; api x2: 1 CPU, 512 MiB, 2 workers; MALLOC_MMAP_THRESHOLD_=131072; 2 uploads per client; peaks from cgroup memory.peak, MiB
|
||||
slots size conc codes p50_ms p95_ms api_idle api_peak api_oom lb_peak lb_oom
|
||||
3 10.0M 40 201x80 2587.5 3641.3 233.2 456.2 0 31.8 0
|
||||
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:17:40Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"upload_concurrency": 3,
|
||||
"mode": "http",
|
||||
"count": 80,
|
||||
"concurrency": 40,
|
||||
"body_bytes": 10485256,
|
||||
"status_codes": {
|
||||
"201": 80
|
||||
},
|
||||
"instances": 2,
|
||||
"linked_in_messages": 0,
|
||||
"elapsed_seconds": 8.053,
|
||||
"successful_rps": 9.93,
|
||||
"latency_ms": {
|
||||
"p50": 2770.4,
|
||||
"p95": 4755.0,
|
||||
"p99": 5507.3,
|
||||
"max": 5507.3
|
||||
},
|
||||
"memory": {
|
||||
"5df14feadc75": {
|
||||
"idle_mib": 230.1,
|
||||
"docker_stats_peak_mib": 411.6,
|
||||
"cgroup_memory_peak_mib": 438.1,
|
||||
"oom_kill": 0
|
||||
},
|
||||
"806f59cf0d4c": {
|
||||
"idle_mib": 231.3,
|
||||
"docker_stats_peak_mib": 401.0,
|
||||
"cgroup_memory_peak_mib": 425.7,
|
||||
"oom_kill": 0
|
||||
}
|
||||
},
|
||||
"lb": {
|
||||
"cgroup_memory_peak_mib": 28.5,
|
||||
"oom_kill": 0
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
# 2026-11-06T09:17:34Z commit 75b93bbba5f29575d3fca1d013cc7e0770d88082; api x2: 1 CPU, 512 MiB, 2 workers; MALLOC_MMAP_THRESHOLD_=131072; 2 uploads per client; peaks from cgroup memory.peak, MiB
|
||||
slots size conc codes p50_ms p95_ms api_idle api_peak api_oom lb_peak lb_oom
|
||||
3 10.0M 40 201x80 2770.4 4755.0 231.3 438.1 0 28.5 0
|
||||
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:18:02Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"upload_concurrency": 3,
|
||||
"mode": "http",
|
||||
"count": 80,
|
||||
"concurrency": 40,
|
||||
"body_bytes": 10485256,
|
||||
"status_codes": {
|
||||
"201": 78,
|
||||
"503": 2
|
||||
},
|
||||
"instances": 2,
|
||||
"linked_in_messages": 0,
|
||||
"elapsed_seconds": 9.545,
|
||||
"successful_rps": 8.17,
|
||||
"latency_ms": {
|
||||
"p50": 3560.9,
|
||||
"p95": 8091.8,
|
||||
"p99": 8772.2,
|
||||
"max": 8772.2
|
||||
},
|
||||
"memory": {
|
||||
"798d7474c368": {
|
||||
"idle_mib": 231.7,
|
||||
"docker_stats_peak_mib": 428.2,
|
||||
"cgroup_memory_peak_mib": 450.4,
|
||||
"oom_kill": 0
|
||||
},
|
||||
"0b9a4f6359fb": {
|
||||
"idle_mib": 179.4,
|
||||
"docker_stats_peak_mib": 410.0,
|
||||
"cgroup_memory_peak_mib": 430.7,
|
||||
"oom_kill": 0
|
||||
}
|
||||
},
|
||||
"lb": {
|
||||
"cgroup_memory_peak_mib": 29.1,
|
||||
"oom_kill": 0
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
# 2026-11-06T09:17:56Z commit 75b93bbba5f29575d3fca1d013cc7e0770d88082; api x2: 1 CPU, 512 MiB, 2 workers; MALLOC_MMAP_THRESHOLD_=131072; 2 uploads per client; peaks from cgroup memory.peak, MiB
|
||||
slots size conc codes p50_ms p95_ms api_idle api_peak api_oom lb_peak lb_oom
|
||||
3 10.0M 40 201x78,503x2 3560.9 8091.8 231.7 450.4 0 29.1 0
|
||||
@@ -1,154 +0,0 @@
|
||||
date: 2026-11-06T09:10:41Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ .venv/bin/python student-tests/tools/forward_network.py
|
||||
{
|
||||
"checks": [
|
||||
{
|
||||
"case": "non_ascii_basic",
|
||||
"raw_hex": "42617369632080",
|
||||
"status": 401,
|
||||
"instance": "d4c8d53d7433"
|
||||
},
|
||||
{
|
||||
"case": "non_ascii_basic",
|
||||
"raw_hex": "426173696320ff",
|
||||
"status": 401,
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
{
|
||||
"case": "non_ascii_basic",
|
||||
"raw_hex": "426173696320c3a9",
|
||||
"status": 401,
|
||||
"instance": "d4c8d53d7433"
|
||||
},
|
||||
{
|
||||
"case": "non_ascii_basic",
|
||||
"raw_hex": "42617369632059577870593255366332566a636d5630ff",
|
||||
"status": 401,
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
{
|
||||
"case": "nul_basic_display_title",
|
||||
"position": "'\\x00'",
|
||||
"status": [
|
||||
401,
|
||||
400,
|
||||
201,
|
||||
400
|
||||
],
|
||||
"instance": "d4c8d53d7433"
|
||||
},
|
||||
{
|
||||
"case": "nul_basic_display_title",
|
||||
"position": "'\\x00abc'",
|
||||
"status": [
|
||||
401,
|
||||
400,
|
||||
201,
|
||||
400
|
||||
],
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
{
|
||||
"case": "nul_basic_display_title",
|
||||
"position": "'abc\\x00def'",
|
||||
"status": [
|
||||
401,
|
||||
400,
|
||||
201,
|
||||
400
|
||||
],
|
||||
"instance": "d4c8d53d7433"
|
||||
},
|
||||
{
|
||||
"case": "nul_basic_display_title",
|
||||
"position": "'abc\\x00'",
|
||||
"status": [
|
||||
401,
|
||||
400,
|
||||
201,
|
||||
400
|
||||
],
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
{
|
||||
"case": "nul_message_corrected_retry",
|
||||
"position": "'\\x00'",
|
||||
"instances": [
|
||||
"da922ab2ea09",
|
||||
"d4c8d53d7433"
|
||||
],
|
||||
"status": [
|
||||
400,
|
||||
201,
|
||||
201
|
||||
],
|
||||
"copies": 1
|
||||
},
|
||||
{
|
||||
"case": "nul_message_corrected_retry",
|
||||
"position": "'\\x00abc'",
|
||||
"instances": [
|
||||
"d4c8d53d7433",
|
||||
"da922ab2ea09"
|
||||
],
|
||||
"status": [
|
||||
400,
|
||||
201,
|
||||
201
|
||||
],
|
||||
"copies": 1
|
||||
},
|
||||
{
|
||||
"case": "nul_message_corrected_retry",
|
||||
"position": "'abc\\x00def'",
|
||||
"instances": [
|
||||
"da922ab2ea09",
|
||||
"d4c8d53d7433"
|
||||
],
|
||||
"status": [
|
||||
400,
|
||||
201,
|
||||
201
|
||||
],
|
||||
"copies": 1
|
||||
},
|
||||
{
|
||||
"case": "nul_message_corrected_retry",
|
||||
"position": "'abc\\x00'",
|
||||
"instances": [
|
||||
"d4c8d53d7433",
|
||||
"da922ab2ea09"
|
||||
],
|
||||
"status": [
|
||||
400,
|
||||
201,
|
||||
201
|
||||
],
|
||||
"copies": 1
|
||||
},
|
||||
{
|
||||
"case": "nul_access",
|
||||
"status": [
|
||||
404,
|
||||
404
|
||||
]
|
||||
},
|
||||
{
|
||||
"case": "logout_across_replicas",
|
||||
"status": [
|
||||
204,
|
||||
401,
|
||||
401,
|
||||
401,
|
||||
401
|
||||
]
|
||||
}
|
||||
],
|
||||
"instances": [
|
||||
"d4c8d53d7433",
|
||||
"da922ab2ea09"
|
||||
],
|
||||
"pass": true
|
||||
}
|
||||
exit_code: 0 elapsed_seconds: 0.403
|
||||
@@ -1,36 +0,0 @@
|
||||
date: 2026-11-06T09:06:38Z commit: f0fc084fbbc6a6084ac9526c50fcee45b2c9a277
|
||||
environment: {"NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ sh -c 'make check && make validate && make lint && make student-test'
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
.venv/bin/ruff check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py
|
||||
All checks passed!
|
||||
.venv/bin/ruff format --check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py
|
||||
163 files already formatted
|
||||
.venv/bin/ty check src student-tests alembic
|
||||
error[invalid-argument-type]: Argument to `HTTPConnection.__init__` is incorrect
|
||||
--> student-tests/tools/forward_network.py:16:39
|
||||
|
|
||||
16 | conn = http.client.HTTPConnection(base.hostname, base.port, timeout=12)
|
||||
| ^^^^^^^^^^^^^ Expected `str`, found `str | None`
|
||||
info: element `None` of union `str | None` is not assignable to `str`
|
||||
info: Method defined here
|
||||
--> stdlib/http/client.pyi:336:13
|
||||
|
|
||||
336 | def __init__(
|
||||
| ^^^^^^^^
|
||||
337 | self,
|
||||
338 | host: str,
|
||||
| --------- Parameter declared here
|
||||
|
||||
error[not-subscriptable]: Cannot subscript object of type `None` with no `__getitem__` method
|
||||
--> student-tests/tools/forward_network.py:28:16
|
||||
|
|
||||
28 | assert result["error"]["request_id"] == request_id
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
Found 2 diagnostics
|
||||
make: *** [lint] Error 1
|
||||
exit_code: 2 elapsed_seconds: 0.678
|
||||
@@ -1,7 +0,0 @@
|
||||
date: 2026-11-06T09:32:35Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {}
|
||||
$ openspec archive forward-lab3-final-review-fixes --yes --skip-specs
|
||||
Task status: ✓ Complete
|
||||
Skipping spec updates (--skip-specs flag provided).
|
||||
Change 'forward-lab3-final-review-fixes' archived as '2026-11-06-forward-lab3-final-review-fixes'.
|
||||
exit_code: 0 elapsed_seconds: 0.776
|
||||
@@ -1,17 +0,0 @@
|
||||
date: 2026-11-06T09:18:19Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ sh -c 'uptime; docker ps --format "{{.Names}} {{.Status}}"; docker stats --no-stream --format "{{.Name}} {{.CPUPerc}} {{.MemUsage}}"'
|
||||
12:18 up 37 days, 11:30, 6 users, load averages: 4.69 4.19 4.16
|
||||
hlpipe-lab4-forward-final-20261106-api-1 Up 2 seconds (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-api-2 Up 2 seconds (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-lb-1 Up 2 seconds (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-postgres-1 Up 5 minutes (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-s3-1 Up 4 minutes (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-valkey-1 Up 5 minutes (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-api-1 0.49% 227.9MiB / 512MiB
|
||||
hlpipe-lab4-forward-final-20261106-api-2 0.83% 227.9MiB / 512MiB
|
||||
hlpipe-lab4-forward-final-20261106-lb-1 1.16% 15.97MiB / 128MiB
|
||||
hlpipe-lab4-forward-final-20261106-postgres-1 2.18% 59.24MiB / 1GiB
|
||||
hlpipe-lab4-forward-final-20261106-s3-1 1.32% 297.5MiB / 512MiB
|
||||
hlpipe-lab4-forward-final-20261106-valkey-1 0.19% 13.54MiB / 128MiB
|
||||
exit_code: 0 elapsed_seconds: 2.646
|
||||
@@ -1,18 +0,0 @@
|
||||
date: 2026-11-06T09:16:14Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ sh -c 'docker info --format "cpus={{.NCPU}} memory={{.MemTotal}}"; uptime; docker ps --format "{{.Names}} {{.Status}}"; docker stats --no-stream --format "{{.Name}} {{.CPUPerc}} {{.MemUsage}}"'
|
||||
cpus=16 memory=8217190400
|
||||
12:16 up 37 days, 11:28, 6 users, load averages: 3.42 4.16 4.16
|
||||
hlpipe-lab4-forward-final-20261106-api-1 Up About a minute (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-api-2 Up 3 minutes (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-postgres-1 Up 3 minutes (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-lb-1 Up 3 minutes (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-s3-1 Up 2 minutes (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-valkey-1 Up 3 minutes (healthy)
|
||||
hlpipe-lab4-forward-final-20261106-api-1 12.78% 258.1MiB / 512MiB
|
||||
hlpipe-lab4-forward-final-20261106-api-2 0.83% 298.8MiB / 512MiB
|
||||
hlpipe-lab4-forward-final-20261106-postgres-1 0.13% 40.44MiB / 1GiB
|
||||
hlpipe-lab4-forward-final-20261106-lb-1 0.14% 24.3MiB / 128MiB
|
||||
hlpipe-lab4-forward-final-20261106-s3-1 0.04% 69.52MiB / 512MiB
|
||||
hlpipe-lab4-forward-final-20261106-valkey-1 1.25% 13.12MiB / 128MiB
|
||||
exit_code: 0 elapsed_seconds: 2.724
|
||||
@@ -1,17 +0,0 @@
|
||||
date: 2026-11-06T09:09:23Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ sh scripts/persistence-evidence.sh
|
||||
date: 2026-11-06T09:09:23Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
== before: service hostname StartedAt status
|
||||
api d4c8d53d7433 2026-11-06T09:09:18.754909134Z running
|
||||
api da922ab2ea09 2026-11-06T09:09:18.824598676Z running
|
||||
lb ea6930f64089 2026-11-06T09:09:12.580488131Z running
|
||||
migrate adc778a3d97c 2026-11-06T09:09:13.657768882Z exited
|
||||
postgres 3f3a870d89c0 2026-11-06T09:09:12.588930798Z running
|
||||
s3 5921e788f03d 2026-11-06T09:09:12.58822809Z running
|
||||
s3-init c90ac1d6c503 2026-11-06T09:09:18.165289926Z exited
|
||||
valkey 07ea16e2fcfe 2026-11-06T09:09:12.587649298Z running
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
|
||||
FAIL: GET /health/live: connection/TLS failure (URLError)
|
||||
make: *** [test-persistence] Error 1
|
||||
exit_code: 2 elapsed_seconds: 0.381
|
||||
@@ -1,26 +0,0 @@
|
||||
date: 2026-11-06T09:10:08Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ sh scripts/persistence-evidence.sh http://127.0.0.1:18084
|
||||
date: 2026-11-06T09:10:08Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
== before: service hostname StartedAt status
|
||||
api d4c8d53d7433 2026-11-06T09:09:18.754909134Z running
|
||||
api da922ab2ea09 2026-11-06T09:09:18.824598676Z running
|
||||
lb ea6930f64089 2026-11-06T09:09:12.580488131Z running
|
||||
migrate adc778a3d97c 2026-11-06T09:09:13.657768882Z exited
|
||||
postgres 3f3a870d89c0 2026-11-06T09:09:12.588930798Z running
|
||||
s3 5921e788f03d 2026-11-06T09:09:12.58822809Z running
|
||||
s3-init c90ac1d6c503 2026-11-06T09:09:18.165289926Z exited
|
||||
valkey 07ea16e2fcfe 2026-11-06T09:09:12.587649298Z running
|
||||
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.
|
||||
== after: service hostname StartedAt status
|
||||
api d4c8d53d7433 2026-11-06T09:10:18.309662551Z running
|
||||
api da922ab2ea09 2026-11-06T09:10:18.377623592Z running
|
||||
lb ea6930f64089 2026-11-06T09:10:12.683407215Z running
|
||||
migrate adc778a3d97c 2026-11-06T09:10:13.202156257Z exited
|
||||
postgres 3f3a870d89c0 2026-11-06T09:10:12.374370839Z running
|
||||
s3 5921e788f03d 2026-11-06T09:10:12.339453423Z running
|
||||
s3-init c90ac1d6c503 2026-11-06T09:10:17.710432217Z exited
|
||||
valkey 07ea16e2fcfe 2026-11-06T09:10:12.392600006Z running
|
||||
exit_code: 0 elapsed_seconds: 13.179
|
||||
@@ -1,37 +0,0 @@
|
||||
date: 2026-11-06T09:33:10Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {}
|
||||
$ sh -c 'make lint && openspec validate --all --strict && openspec list --json && git diff --check && git diff --exit-code d7478726a85791c21e065d58f610735a9e687433 -- contracts tests README.md COURSE.md'
|
||||
.venv/bin/ruff check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py
|
||||
All checks passed!
|
||||
.venv/bin/ruff format --check src student-tests scripts/capture_evidence.py alembic scripts/scaling.py tools scripts/probe.py scripts/limits.py scripts/lab4_scenarios.py scripts/lab4_seed.py scripts/upload_memory.py scripts/reconcile_check.py scripts/reconcile_track.py
|
||||
163 files already formatted
|
||||
.venv/bin/ty check src student-tests alembic
|
||||
All checks passed!
|
||||
- Validating...
|
||||
✓ spec/lab1-event-publication
|
||||
✓ spec/lab1-messenger-chats
|
||||
✓ spec/lab1-messenger-history
|
||||
✓ spec/lab1-messenger-identity
|
||||
✓ spec/lab1-service-operability
|
||||
✓ spec/lab2-auth-sessions
|
||||
✓ spec/lab2-dependency-failures
|
||||
✓ spec/lab2-history-index
|
||||
✓ spec/lab2-persistent-storage
|
||||
✓ spec/lab2-session-cache
|
||||
✓ spec/lab3-failover-operations
|
||||
✓ spec/lab3-idempotent-messages
|
||||
✓ spec/lab3-load-balancing
|
||||
✓ spec/lab4-attachments
|
||||
✓ spec/lab4-evidence-runs
|
||||
✓ spec/lab4-object-storage
|
||||
✓ spec/lab4-storage-reconciler
|
||||
✓ spec/lab4-upload-resilience
|
||||
Totals: 18 passed, 0 failed (18 items)
|
||||
{
|
||||
"changes": [],
|
||||
"root": {
|
||||
"path": "<repo>",
|
||||
"source": "nearest"
|
||||
}
|
||||
}
|
||||
exit_code: 0 elapsed_seconds: 1.921
|
||||
@@ -1,19 +0,0 @@
|
||||
date: 2026-11-06T09:19:41Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-reconcile-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:hlpipe-lab4-forward-final-20261106"}
|
||||
$ make reconcile-demo 'ARGS=--out evidence/forward-final-2026-11-06/reconcile-demo'
|
||||
python3 scripts/reconcile_track.py demo --base-url "http://127.0.0.1:18084" --out evidence/forward-final-2026-11-06/reconcile-demo
|
||||
PASS dry-run находит каждый внедрённый класс, и найдено ровно внедрённое
|
||||
PASS dry-run ничего не меняет
|
||||
PASS apply исправляет ровно найденное dry-run, удаление намерений — в журнале аудита
|
||||
PASS повторный apply — 0 действий
|
||||
PASS независимая проверка после apply: нарушений нет, готовые не потеряны
|
||||
PASS строки с расхождениями и ссылки сообщений сохранены
|
||||
PASS карантин: метаданные 200, /content 404; нетронутое скачивается
|
||||
PASS вернули те же байты — карантин снят; другие байты той же длины — остался
|
||||
PASS второй одновременный проход пропущен
|
||||
PASS SIGTERM: идущий проход останавливается за секунды, блокировка освобождена
|
||||
PASS S3 остановлен: код 1 за ограниченное время, состояние не изменилось
|
||||
PASS под нагрузкой: исправлены только внедрённые, ошибок нет
|
||||
PASS под нагрузкой: все 201 готовы и совпадают по SHA-256, потерь 0
|
||||
{"ok": true, "checks": 13}
|
||||
exit_code: 0 elapsed_seconds: 257.493
|
||||
@@ -1,142 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:20:54Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"mode": "apply",
|
||||
"skipped": false,
|
||||
"grace_seconds": 60,
|
||||
"skew_seconds": 0,
|
||||
"deep": true,
|
||||
"page_size": 1000,
|
||||
"scanned": {
|
||||
"objects": 24,
|
||||
"rows": 27
|
||||
},
|
||||
"found": {
|
||||
"orphan_stale": 3,
|
||||
"orphan_fresh": 2,
|
||||
"missing": 3,
|
||||
"size_mismatch": 3,
|
||||
"sha_mismatch": 3,
|
||||
"pending_stale": 6,
|
||||
"pending_fresh": 2,
|
||||
"quarantined": 0,
|
||||
"healed": 0
|
||||
},
|
||||
"fixed": {
|
||||
"orphan_stale": 3,
|
||||
"missing": 3,
|
||||
"size_mismatch": 3,
|
||||
"sha_mismatch": 3,
|
||||
"pending_stale": 6,
|
||||
"healed": 0
|
||||
},
|
||||
"rechecked": {},
|
||||
"errors": 0,
|
||||
"samples": {
|
||||
"missing": [
|
||||
"01a1b028-2293-743d-a00c-f7fec1a50808",
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10",
|
||||
"01a1b028-2306-74ed-9bff-7c2894a33621"
|
||||
],
|
||||
"size_mismatch": [
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1",
|
||||
"01a1b028-2316-7510-b41e-754b39583de9",
|
||||
"01a1b028-231e-70ba-8a9e-1de6d00c2e0d"
|
||||
],
|
||||
"sha_mismatch": [
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e",
|
||||
"01a1b028-2327-7105-838f-3f0df5b10dc2",
|
||||
"01a1b028-2330-7662-8f98-6b45a5c165a2"
|
||||
],
|
||||
"pending_stale": [
|
||||
"2cc53ddd-063f-4edc-ae55-98f201965b7f",
|
||||
"73fc548a-79a1-4396-a848-2e598eba75a1",
|
||||
"848bed6c-437a-4169-8cca-940c1987055b",
|
||||
"99d824a9-d16d-481e-9804-e209f2fa410b",
|
||||
"a0a3b632-5fe3-447e-a93b-bbdce77c4fb1",
|
||||
"d86c4cba-2836-4150-bf0e-d32e1ec442ec"
|
||||
],
|
||||
"orphan_stale": [
|
||||
"attachments/35df74ac-5753-48e0-b106-d596db2ca8e6",
|
||||
"attachments/8ba5a522-a4b8-40a8-b1f3-274401976db6",
|
||||
"attachments/de3cc053-2a20-44ad-b223-e06818b039e7"
|
||||
],
|
||||
"orphan_fresh": [
|
||||
"attachments/7b96d477-2dc4-4a8c-8703-e6176a7e46a6",
|
||||
"attachments/d69d9843-ceab-4101-a278-7e5974071ac6"
|
||||
],
|
||||
"pending_fresh": [
|
||||
"dfb03912-2304-4280-bfb7-7a7b9cb28597",
|
||||
"f1cf4216-9e57-4217-866a-440aac9435f3"
|
||||
]
|
||||
},
|
||||
"cost": {
|
||||
"seconds": 0.119,
|
||||
"requests": {
|
||||
"s3_list": 1,
|
||||
"s3_head": 6,
|
||||
"s3_get": 13,
|
||||
"s3_delete": 9,
|
||||
"sql": 19
|
||||
},
|
||||
"waited_seconds": {
|
||||
"s3_list": 0.018,
|
||||
"sql": 0.006
|
||||
},
|
||||
"hashed_bytes": 1453621,
|
||||
"cpu_seconds": 0.621,
|
||||
"max_rss_mib": 107.6
|
||||
},
|
||||
"exit_code": 0,
|
||||
"wall_seconds": 1.106,
|
||||
"audit": [
|
||||
{
|
||||
"attachment_id": "2cc53ddd-063f-4edc-ae55-98f201965b7f",
|
||||
"chat_id": "01a1b028-1d47-75b7-a3d7-f9dda0509d40",
|
||||
"reason": "reconcile",
|
||||
"event": "audit.attachment_discarded",
|
||||
"level": "info",
|
||||
"ts": "2026-11-06T09:20:54.712257Z"
|
||||
},
|
||||
{
|
||||
"attachment_id": "73fc548a-79a1-4396-a848-2e598eba75a1",
|
||||
"chat_id": "01a1b028-1d47-75b7-a3d7-f9dda0509d40",
|
||||
"reason": "reconcile",
|
||||
"event": "audit.attachment_discarded",
|
||||
"level": "info",
|
||||
"ts": "2026-11-06T09:20:54.724316Z"
|
||||
},
|
||||
{
|
||||
"attachment_id": "848bed6c-437a-4169-8cca-940c1987055b",
|
||||
"chat_id": "01a1b028-1d47-75b7-a3d7-f9dda0509d40",
|
||||
"reason": "reconcile",
|
||||
"event": "audit.attachment_discarded",
|
||||
"level": "info",
|
||||
"ts": "2026-11-06T09:20:54.732394Z"
|
||||
},
|
||||
{
|
||||
"attachment_id": "99d824a9-d16d-481e-9804-e209f2fa410b",
|
||||
"chat_id": "01a1b028-1d47-75b7-a3d7-f9dda0509d40",
|
||||
"reason": "reconcile",
|
||||
"event": "audit.attachment_discarded",
|
||||
"level": "info",
|
||||
"ts": "2026-11-06T09:20:54.741795Z"
|
||||
},
|
||||
{
|
||||
"attachment_id": "a0a3b632-5fe3-447e-a93b-bbdce77c4fb1",
|
||||
"chat_id": "01a1b028-1d47-75b7-a3d7-f9dda0509d40",
|
||||
"reason": "reconcile",
|
||||
"event": "audit.attachment_discarded",
|
||||
"level": "info",
|
||||
"ts": "2026-11-06T09:20:54.749494Z"
|
||||
},
|
||||
{
|
||||
"attachment_id": "d86c4cba-2836-4150-bf0e-d32e1ec442ec",
|
||||
"chat_id": "01a1b028-1d47-75b7-a3d7-f9dda0509d40",
|
||||
"reason": "reconcile",
|
||||
"event": "audit.attachment_discarded",
|
||||
"level": "info",
|
||||
"ts": "2026-11-06T09:20:54.757598Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:20:55Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"mode": "apply",
|
||||
"skipped": false,
|
||||
"grace_seconds": 60,
|
||||
"skew_seconds": 0,
|
||||
"deep": true,
|
||||
"page_size": 1000,
|
||||
"scanned": {
|
||||
"objects": 18,
|
||||
"rows": 21
|
||||
},
|
||||
"found": {
|
||||
"orphan_stale": 0,
|
||||
"orphan_fresh": 2,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"pending_fresh": 2,
|
||||
"quarantined": 9,
|
||||
"healed": 0
|
||||
},
|
||||
"fixed": {
|
||||
"orphan_stale": 0,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"healed": 0
|
||||
},
|
||||
"rechecked": {},
|
||||
"errors": 0,
|
||||
"samples": {
|
||||
"quarantined": [
|
||||
"01a1b028-2293-743d-a00c-f7fec1a50808",
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10",
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1",
|
||||
"01a1b028-2306-74ed-9bff-7c2894a33621",
|
||||
"01a1b028-2316-7510-b41e-754b39583de9",
|
||||
"01a1b028-231e-70ba-8a9e-1de6d00c2e0d",
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e",
|
||||
"01a1b028-2327-7105-838f-3f0df5b10dc2",
|
||||
"01a1b028-2330-7662-8f98-6b45a5c165a2"
|
||||
],
|
||||
"orphan_fresh": [
|
||||
"attachments/7b96d477-2dc4-4a8c-8703-e6176a7e46a6",
|
||||
"attachments/d69d9843-ceab-4101-a278-7e5974071ac6"
|
||||
],
|
||||
"pending_fresh": [
|
||||
"dfb03912-2304-4280-bfb7-7a7b9cb28597",
|
||||
"f1cf4216-9e57-4217-866a-440aac9435f3"
|
||||
]
|
||||
},
|
||||
"cost": {
|
||||
"seconds": 0.043,
|
||||
"requests": {
|
||||
"s3_list": 1,
|
||||
"s3_head": 0,
|
||||
"s3_get": 13,
|
||||
"s3_delete": 0,
|
||||
"sql": 1
|
||||
},
|
||||
"waited_seconds": {
|
||||
"s3_list": 0.017,
|
||||
"sql": 0.006
|
||||
},
|
||||
"hashed_bytes": 1453621,
|
||||
"cpu_seconds": 0.595,
|
||||
"max_rss_mib": 107.4
|
||||
},
|
||||
"exit_code": 0,
|
||||
"wall_seconds": 1.021,
|
||||
"audit": []
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"checked_at": "2026-11-06T09:20:57Z",
|
||||
"grace_seconds": 60,
|
||||
"deep": true,
|
||||
"objects": 18,
|
||||
"rows": 21,
|
||||
"ready_healthy": 10,
|
||||
"counts": {
|
||||
"orphan_stale": 0,
|
||||
"orphan_fresh": 2,
|
||||
"missing_referenced": 0,
|
||||
"missing_unreferenced": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale_with_object": 0,
|
||||
"pending_stale_without_object": 0,
|
||||
"pending_fresh": 2,
|
||||
"quarantined": 9,
|
||||
"incomplete_stale": 0,
|
||||
"incomplete_fresh": 0,
|
||||
"lost_ready": 0
|
||||
},
|
||||
"samples": {
|
||||
"orphan_fresh": [
|
||||
"attachments/7b96d477-2dc4-4a8c-8703-e6176a7e46a6",
|
||||
"attachments/d69d9843-ceab-4101-a278-7e5974071ac6"
|
||||
],
|
||||
"pending_fresh": [
|
||||
"dfb03912-2304-4280-bfb7-7a7b9cb28597",
|
||||
"f1cf4216-9e57-4217-866a-440aac9435f3"
|
||||
],
|
||||
"quarantined": [
|
||||
"01a1b028-2293-743d-a00c-f7fec1a50808",
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10",
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1",
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e",
|
||||
"01a1b028-2306-74ed-9bff-7c2894a33621",
|
||||
"01a1b028-2316-7510-b41e-754b39583de9",
|
||||
"01a1b028-231e-70ba-8a9e-1de6d00c2e0d",
|
||||
"01a1b028-2327-7105-838f-3f0df5b10dc2",
|
||||
"01a1b028-2330-7662-8f98-6b45a5c165a2"
|
||||
]
|
||||
},
|
||||
"seconds": {
|
||||
"s3_list": 0.3,
|
||||
"s3_incomplete": 0.325,
|
||||
"pg_query": 0.128,
|
||||
"deep_hash": 0.593,
|
||||
"total": 1.348
|
||||
},
|
||||
"violations": [],
|
||||
"ok": true
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
{
|
||||
"checked_at": "2026-11-06T09:20:51Z",
|
||||
"grace_seconds": 60,
|
||||
"deep": true,
|
||||
"objects": 24,
|
||||
"rows": 27,
|
||||
"ready_healthy": 10,
|
||||
"counts": {
|
||||
"orphan_stale": 3,
|
||||
"orphan_fresh": 2,
|
||||
"missing_referenced": 2,
|
||||
"missing_unreferenced": 1,
|
||||
"size_mismatch": 3,
|
||||
"sha_mismatch": 3,
|
||||
"pending_stale_with_object": 3,
|
||||
"pending_stale_without_object": 3,
|
||||
"pending_fresh": 2,
|
||||
"quarantined": 0,
|
||||
"incomplete_stale": 0,
|
||||
"incomplete_fresh": 0,
|
||||
"lost_ready": 0
|
||||
},
|
||||
"samples": {
|
||||
"orphan_stale": [
|
||||
"attachments/35df74ac-5753-48e0-b106-d596db2ca8e6",
|
||||
"attachments/8ba5a522-a4b8-40a8-b1f3-274401976db6",
|
||||
"attachments/de3cc053-2a20-44ad-b223-e06818b039e7"
|
||||
],
|
||||
"orphan_fresh": [
|
||||
"attachments/7b96d477-2dc4-4a8c-8703-e6176a7e46a6",
|
||||
"attachments/d69d9843-ceab-4101-a278-7e5974071ac6"
|
||||
],
|
||||
"missing_referenced": [
|
||||
"01a1b028-2293-743d-a00c-f7fec1a50808",
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10"
|
||||
],
|
||||
"missing_unreferenced": [
|
||||
"01a1b028-2306-74ed-9bff-7c2894a33621"
|
||||
],
|
||||
"size_mismatch": [
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1",
|
||||
"01a1b028-2316-7510-b41e-754b39583de9",
|
||||
"01a1b028-231e-70ba-8a9e-1de6d00c2e0d"
|
||||
],
|
||||
"sha_mismatch": [
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e",
|
||||
"01a1b028-2327-7105-838f-3f0df5b10dc2",
|
||||
"01a1b028-2330-7662-8f98-6b45a5c165a2"
|
||||
],
|
||||
"pending_stale_with_object": [
|
||||
"848bed6c-437a-4169-8cca-940c1987055b",
|
||||
"a0a3b632-5fe3-447e-a93b-bbdce77c4fb1",
|
||||
"d86c4cba-2836-4150-bf0e-d32e1ec442ec"
|
||||
],
|
||||
"pending_stale_without_object": [
|
||||
"2cc53ddd-063f-4edc-ae55-98f201965b7f",
|
||||
"73fc548a-79a1-4396-a848-2e598eba75a1",
|
||||
"99d824a9-d16d-481e-9804-e209f2fa410b"
|
||||
],
|
||||
"pending_fresh": [
|
||||
"dfb03912-2304-4280-bfb7-7a7b9cb28597",
|
||||
"f1cf4216-9e57-4217-866a-440aac9435f3"
|
||||
]
|
||||
},
|
||||
"seconds": {
|
||||
"s3_list": 0.304,
|
||||
"s3_incomplete": 0.347,
|
||||
"pg_query": 0.112,
|
||||
"deep_hash": 0.556,
|
||||
"total": 1.319
|
||||
},
|
||||
"violations": [
|
||||
"orphan_stale",
|
||||
"missing_referenced",
|
||||
"missing_unreferenced",
|
||||
"size_mismatch",
|
||||
"sha_mismatch",
|
||||
"pending_stale_with_object",
|
||||
"pending_stale_without_object"
|
||||
],
|
||||
"ok": false
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"checked_at": "2026-11-06T09:23:59Z",
|
||||
"grace_seconds": 60,
|
||||
"deep": true,
|
||||
"objects": 3382,
|
||||
"rows": 3383,
|
||||
"ready_healthy": 3375,
|
||||
"counts": {
|
||||
"orphan_stale": 0,
|
||||
"orphan_fresh": 0,
|
||||
"missing_referenced": 0,
|
||||
"missing_unreferenced": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale_with_object": 0,
|
||||
"pending_stale_without_object": 0,
|
||||
"pending_fresh": 0,
|
||||
"quarantined": 8,
|
||||
"incomplete_stale": 0,
|
||||
"incomplete_fresh": 0,
|
||||
"lost_ready": 0
|
||||
},
|
||||
"samples": {
|
||||
"quarantined": [
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10",
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1",
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e",
|
||||
"01a1b028-2306-74ed-9bff-7c2894a33621",
|
||||
"01a1b028-2316-7510-b41e-754b39583de9",
|
||||
"01a1b028-231e-70ba-8a9e-1de6d00c2e0d",
|
||||
"01a1b028-2327-7105-838f-3f0df5b10dc2",
|
||||
"01a1b028-2330-7662-8f98-6b45a5c165a2"
|
||||
]
|
||||
},
|
||||
"seconds": {
|
||||
"s3_list": 0.677,
|
||||
"s3_incomplete": 0.367,
|
||||
"pg_query": 0.149,
|
||||
"deep_hash": 67.224,
|
||||
"total": 68.428
|
||||
},
|
||||
"violations": [],
|
||||
"ok": true
|
||||
}
|
||||
@@ -1,245 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:23:59Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"started_at": "2026-11-06T09:19:42Z",
|
||||
"faults": {
|
||||
"injected": {
|
||||
"orphan_stale": [
|
||||
"35df74ac-5753-48e0-b106-d596db2ca8e6",
|
||||
"de3cc053-2a20-44ad-b223-e06818b039e7",
|
||||
"8ba5a522-a4b8-40a8-b1f3-274401976db6"
|
||||
],
|
||||
"missing": [
|
||||
"01a1b028-2306-74ed-9bff-7c2894a33621",
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10",
|
||||
"01a1b028-2293-743d-a00c-f7fec1a50808"
|
||||
],
|
||||
"size_mismatch": [
|
||||
"01a1b028-231e-70ba-8a9e-1de6d00c2e0d",
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1",
|
||||
"01a1b028-2316-7510-b41e-754b39583de9"
|
||||
],
|
||||
"sha_mismatch": [
|
||||
"01a1b028-2330-7662-8f98-6b45a5c165a2",
|
||||
"01a1b028-2327-7105-838f-3f0df5b10dc2",
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e"
|
||||
],
|
||||
"pending_stale": [
|
||||
"2cc53ddd-063f-4edc-ae55-98f201965b7f",
|
||||
"99d824a9-d16d-481e-9804-e209f2fa410b",
|
||||
"73fc548a-79a1-4396-a848-2e598eba75a1",
|
||||
"a0a3b632-5fe3-447e-a93b-bbdce77c4fb1",
|
||||
"848bed6c-437a-4169-8cca-940c1987055b",
|
||||
"d86c4cba-2836-4150-bf0e-d32e1ec442ec"
|
||||
],
|
||||
"orphan_fresh": [
|
||||
"d69d9843-ceab-4101-a278-7e5974071ac6",
|
||||
"7b96d477-2dc4-4a8c-8703-e6176a7e46a6"
|
||||
],
|
||||
"pending_fresh": [
|
||||
"f1cf4216-9e57-4217-866a-440aac9435f3",
|
||||
"dfb03912-2304-4280-bfb7-7a7b9cb28597"
|
||||
]
|
||||
},
|
||||
"targets": {
|
||||
"missing": [
|
||||
"01a1b028-2293-743d-a00c-f7fec1a50808",
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10",
|
||||
"01a1b028-2306-74ed-9bff-7c2894a33621"
|
||||
],
|
||||
"corrupt": [
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1",
|
||||
"01a1b028-2316-7510-b41e-754b39583de9",
|
||||
"01a1b028-231e-70ba-8a9e-1de6d00c2e0d"
|
||||
],
|
||||
"bitflip": [
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e",
|
||||
"01a1b028-2327-7105-838f-3f0df5b10dc2",
|
||||
"01a1b028-2330-7662-8f98-6b45a5c165a2"
|
||||
]
|
||||
},
|
||||
"linked": [
|
||||
"01a1b028-2293-743d-a00c-f7fec1a50808",
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10",
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1",
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e",
|
||||
"01a1b028-22cb-73b4-92c8-0db140de50a1",
|
||||
"01a1b028-22d2-7761-8bdd-8b9987dcd70f"
|
||||
]
|
||||
},
|
||||
"seconds": 256.6,
|
||||
"checks": [
|
||||
{
|
||||
"name": "dry-run находит каждый внедрённый класс, и найдено ровно внедрённое",
|
||||
"ok": true,
|
||||
"expected": {
|
||||
"orphan_stale": 3,
|
||||
"missing": 3,
|
||||
"size_mismatch": 3,
|
||||
"sha_mismatch": 3,
|
||||
"pending_stale": 6,
|
||||
"orphan_fresh": 2,
|
||||
"pending_fresh": 2,
|
||||
"quarantined": 0
|
||||
},
|
||||
"found": {
|
||||
"orphan_stale": 3,
|
||||
"orphan_fresh": 2,
|
||||
"missing": 3,
|
||||
"size_mismatch": 3,
|
||||
"sha_mismatch": 3,
|
||||
"pending_stale": 6,
|
||||
"pending_fresh": 2,
|
||||
"quarantined": 0,
|
||||
"healed": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dry-run ничего не меняет",
|
||||
"ok": true,
|
||||
"objects": [
|
||||
24,
|
||||
24
|
||||
],
|
||||
"rows": [
|
||||
27,
|
||||
27
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "apply исправляет ровно найденное dry-run, удаление намерений — в журнале аудита",
|
||||
"ok": true,
|
||||
"dry_run": {
|
||||
"orphan_stale": 3,
|
||||
"missing": 3,
|
||||
"size_mismatch": 3,
|
||||
"sha_mismatch": 3,
|
||||
"pending_stale": 6
|
||||
},
|
||||
"fixed": {
|
||||
"orphan_stale": 3,
|
||||
"missing": 3,
|
||||
"size_mismatch": 3,
|
||||
"sha_mismatch": 3,
|
||||
"pending_stale": 6
|
||||
},
|
||||
"audit_discarded": 6
|
||||
},
|
||||
{
|
||||
"name": "повторный apply — 0 действий",
|
||||
"ok": true,
|
||||
"fixed": {
|
||||
"orphan_stale": 0,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"healed": 0
|
||||
},
|
||||
"found": {
|
||||
"orphan_stale": 0,
|
||||
"orphan_fresh": 2,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"pending_fresh": 2,
|
||||
"quarantined": 9,
|
||||
"healed": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "независимая проверка после apply: нарушений нет, готовые не потеряны",
|
||||
"ok": true,
|
||||
"counts": {
|
||||
"orphan_stale": 0,
|
||||
"orphan_fresh": 2,
|
||||
"missing_referenced": 0,
|
||||
"missing_unreferenced": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale_with_object": 0,
|
||||
"pending_stale_without_object": 0,
|
||||
"pending_fresh": 2,
|
||||
"quarantined": 9,
|
||||
"incomplete_stale": 0,
|
||||
"incomplete_fresh": 0,
|
||||
"lost_ready": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "строки с расхождениями и ссылки сообщений сохранены",
|
||||
"ok": true,
|
||||
"quarantine": {
|
||||
"01a1b028-2293-743d-a00c-f7fec1a50808": "missing",
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10": "missing",
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1": "size_mismatch",
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e": "sha_mismatch",
|
||||
"01a1b028-2306-74ed-9bff-7c2894a33621": "missing",
|
||||
"01a1b028-2316-7510-b41e-754b39583de9": "size_mismatch",
|
||||
"01a1b028-231e-70ba-8a9e-1de6d00c2e0d": "size_mismatch",
|
||||
"01a1b028-2327-7105-838f-3f0df5b10dc2": "sha_mismatch",
|
||||
"01a1b028-2330-7662-8f98-6b45a5c165a2": "sha_mismatch"
|
||||
},
|
||||
"message_links": 6
|
||||
},
|
||||
{
|
||||
"name": "карантин: метаданные 200, /content 404; нетронутое скачивается",
|
||||
"ok": true
|
||||
},
|
||||
{
|
||||
"name": "вернули те же байты — карантин снят; другие байты той же длины — остался",
|
||||
"ok": true,
|
||||
"fixed": {
|
||||
"orphan_stale": 0,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"healed": 1
|
||||
},
|
||||
"s3_get": 5
|
||||
},
|
||||
{
|
||||
"name": "второй одновременный проход пропущен",
|
||||
"ok": true
|
||||
},
|
||||
{
|
||||
"name": "SIGTERM: идущий проход останавливается за секунды, блокировка освобождена",
|
||||
"ok": true,
|
||||
"s3": "paused",
|
||||
"state_before_stop": "running",
|
||||
"init": "true",
|
||||
"stop_seconds": 0.1,
|
||||
"exit_code": 143,
|
||||
"next_pass_skipped": false
|
||||
},
|
||||
{
|
||||
"name": "S3 остановлен: код 1 за ограниченное время, состояние не изменилось",
|
||||
"ok": true,
|
||||
"exit_code": 1,
|
||||
"wall_seconds": 2.32
|
||||
},
|
||||
{
|
||||
"name": "под нагрузкой: исправлены только внедрённые, ошибок нет",
|
||||
"ok": true,
|
||||
"fixed": {
|
||||
"orphan_stale": 5,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 5
|
||||
},
|
||||
"runs": 59
|
||||
},
|
||||
{
|
||||
"name": "под нагрузкой: все 201 готовы и совпадают по SHA-256, потерь 0",
|
||||
"ok": true,
|
||||
"uploads": {
|
||||
"201": 3364
|
||||
},
|
||||
"lost_ready": 0
|
||||
}
|
||||
],
|
||||
"ok": true
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:20:52Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"mode": "dry-run",
|
||||
"skipped": false,
|
||||
"grace_seconds": 60,
|
||||
"skew_seconds": 0,
|
||||
"deep": true,
|
||||
"page_size": 1000,
|
||||
"scanned": {
|
||||
"objects": 24,
|
||||
"rows": 27
|
||||
},
|
||||
"found": {
|
||||
"orphan_stale": 3,
|
||||
"orphan_fresh": 2,
|
||||
"missing": 3,
|
||||
"size_mismatch": 3,
|
||||
"sha_mismatch": 3,
|
||||
"pending_stale": 6,
|
||||
"pending_fresh": 2,
|
||||
"quarantined": 0,
|
||||
"healed": 0
|
||||
},
|
||||
"fixed": {
|
||||
"orphan_stale": 0,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"healed": 0
|
||||
},
|
||||
"rechecked": {},
|
||||
"errors": 0,
|
||||
"samples": {
|
||||
"missing": [
|
||||
"01a1b028-2293-743d-a00c-f7fec1a50808",
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10",
|
||||
"01a1b028-2306-74ed-9bff-7c2894a33621"
|
||||
],
|
||||
"size_mismatch": [
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1",
|
||||
"01a1b028-2316-7510-b41e-754b39583de9",
|
||||
"01a1b028-231e-70ba-8a9e-1de6d00c2e0d"
|
||||
],
|
||||
"sha_mismatch": [
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e",
|
||||
"01a1b028-2327-7105-838f-3f0df5b10dc2",
|
||||
"01a1b028-2330-7662-8f98-6b45a5c165a2"
|
||||
],
|
||||
"pending_stale": [
|
||||
"2cc53ddd-063f-4edc-ae55-98f201965b7f",
|
||||
"73fc548a-79a1-4396-a848-2e598eba75a1",
|
||||
"848bed6c-437a-4169-8cca-940c1987055b",
|
||||
"99d824a9-d16d-481e-9804-e209f2fa410b",
|
||||
"a0a3b632-5fe3-447e-a93b-bbdce77c4fb1",
|
||||
"d86c4cba-2836-4150-bf0e-d32e1ec442ec"
|
||||
],
|
||||
"orphan_stale": [
|
||||
"attachments/35df74ac-5753-48e0-b106-d596db2ca8e6",
|
||||
"attachments/8ba5a522-a4b8-40a8-b1f3-274401976db6",
|
||||
"attachments/de3cc053-2a20-44ad-b223-e06818b039e7"
|
||||
],
|
||||
"orphan_fresh": [
|
||||
"attachments/7b96d477-2dc4-4a8c-8703-e6176a7e46a6",
|
||||
"attachments/d69d9843-ceab-4101-a278-7e5974071ac6"
|
||||
],
|
||||
"pending_fresh": [
|
||||
"dfb03912-2304-4280-bfb7-7a7b9cb28597",
|
||||
"f1cf4216-9e57-4217-866a-440aac9435f3"
|
||||
]
|
||||
},
|
||||
"cost": {
|
||||
"seconds": 0.04,
|
||||
"requests": {
|
||||
"s3_list": 1,
|
||||
"s3_head": 0,
|
||||
"s3_get": 13,
|
||||
"s3_delete": 0,
|
||||
"sql": 1
|
||||
},
|
||||
"waited_seconds": {
|
||||
"s3_list": 0.016,
|
||||
"sql": 0.006
|
||||
},
|
||||
"hashed_bytes": 1453621,
|
||||
"cpu_seconds": 0.594,
|
||||
"max_rss_mib": 107.4
|
||||
},
|
||||
"exit_code": 0,
|
||||
"wall_seconds": 1.013,
|
||||
"audit": []
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:20:59Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"mode": "apply",
|
||||
"skipped": false,
|
||||
"grace_seconds": 60,
|
||||
"skew_seconds": 0,
|
||||
"deep": false,
|
||||
"page_size": 1000,
|
||||
"scanned": {
|
||||
"objects": 20,
|
||||
"rows": 21
|
||||
},
|
||||
"found": {
|
||||
"orphan_stale": 0,
|
||||
"orphan_fresh": 2,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"pending_fresh": 2,
|
||||
"quarantined": 8,
|
||||
"healed": 1
|
||||
},
|
||||
"fixed": {
|
||||
"orphan_stale": 0,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"healed": 1
|
||||
},
|
||||
"rechecked": {},
|
||||
"errors": 0,
|
||||
"samples": {
|
||||
"quarantined": [
|
||||
"01a1b028-22ba-778b-99d5-eef1d99349f1",
|
||||
"01a1b028-2306-74ed-9bff-7c2894a33621",
|
||||
"01a1b028-2316-7510-b41e-754b39583de9",
|
||||
"01a1b028-231e-70ba-8a9e-1de6d00c2e0d",
|
||||
"01a1b028-22ad-77fa-9b2e-d01e032a2c10",
|
||||
"01a1b028-2330-7662-8f98-6b45a5c165a2",
|
||||
"01a1b028-22c2-7713-adf4-93a25c06e07e",
|
||||
"01a1b028-2327-7105-838f-3f0df5b10dc2"
|
||||
],
|
||||
"orphan_fresh": [
|
||||
"attachments/7b96d477-2dc4-4a8c-8703-e6176a7e46a6",
|
||||
"attachments/d69d9843-ceab-4101-a278-7e5974071ac6"
|
||||
],
|
||||
"pending_fresh": [
|
||||
"dfb03912-2304-4280-bfb7-7a7b9cb28597",
|
||||
"f1cf4216-9e57-4217-866a-440aac9435f3"
|
||||
],
|
||||
"healed": [
|
||||
"01a1b028-2293-743d-a00c-f7fec1a50808"
|
||||
]
|
||||
},
|
||||
"cost": {
|
||||
"seconds": 0.04,
|
||||
"requests": {
|
||||
"s3_list": 1,
|
||||
"s3_head": 0,
|
||||
"s3_get": 5,
|
||||
"s3_delete": 0,
|
||||
"sql": 2
|
||||
},
|
||||
"waited_seconds": {
|
||||
"s3_list": 0.019,
|
||||
"sql": 0.006
|
||||
},
|
||||
"hashed_bytes": 559085,
|
||||
"cpu_seconds": 0.607,
|
||||
"max_rss_mib": 107.5
|
||||
},
|
||||
"exit_code": 0,
|
||||
"wall_seconds": 1.074,
|
||||
"audit": []
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:21:14Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"mode": "apply",
|
||||
"skipped": true,
|
||||
"grace_seconds": 60,
|
||||
"skew_seconds": 0,
|
||||
"deep": false,
|
||||
"page_size": 1000,
|
||||
"scanned": {
|
||||
"objects": 0,
|
||||
"rows": 0
|
||||
},
|
||||
"found": {
|
||||
"orphan_stale": 0,
|
||||
"orphan_fresh": 0,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"pending_fresh": 0,
|
||||
"quarantined": 0,
|
||||
"healed": 0
|
||||
},
|
||||
"fixed": {
|
||||
"orphan_stale": 0,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"healed": 0
|
||||
},
|
||||
"rechecked": {},
|
||||
"errors": 0,
|
||||
"samples": {},
|
||||
"cost": {
|
||||
"seconds": 0.008,
|
||||
"requests": {
|
||||
"s3_list": 0,
|
||||
"s3_head": 0,
|
||||
"s3_get": 0,
|
||||
"s3_delete": 0,
|
||||
"sql": 0
|
||||
},
|
||||
"waited_seconds": {},
|
||||
"hashed_bytes": 0,
|
||||
"cpu_seconds": 0.549,
|
||||
"max_rss_mib": 106.5
|
||||
},
|
||||
"exit_code": 0,
|
||||
"wall_seconds": 0.917,
|
||||
"audit": []
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{"01a1b028-1dde-7345-971e-c4c24622ef5d": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2293-743d-a00c-f7fec1a50808": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-22ad-77fa-9b2e-d01e032a2c10": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-22ba-778b-99d5-eef1d99349f1": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-22c2-7713-adf4-93a25c06e07e": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-22cb-73b4-92c8-0db140de50a1": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-22d2-7761-8bdd-8b9987dcd70f": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2306-74ed-9bff-7c2894a33621": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2316-7510-b41e-754b39583de9": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-231e-70ba-8a9e-1de6d00c2e0d": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2327-7105-838f-3f0df5b10dc2": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2330-7662-8f98-6b45a5c165a2": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2339-7091-b944-16c65cfce6f9": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2341-737d-b71f-ed06fdf083e5": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2349-7776-b1f8-5d8380dec796": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2351-7605-96d5-b39a1ad9df0f": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2359-72bc-add8-a22020ccf80a": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2361-71b8-b4bd-4227e8de54bc": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75", "01a1b028-2369-7670-9824-9c1871789b60": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75"}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"01a1b028-1dde-7345-971e-c4c24622ef5d": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"01a1b028-22cb-73b4-92c8-0db140de50a1": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"01a1b028-22d2-7761-8bdd-8b9987dcd70f": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"01a1b028-2339-7091-b944-16c65cfce6f9": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"01a1b028-2341-737d-b71f-ed06fdf083e5": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"01a1b028-2349-7776-b1f8-5d8380dec796": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"01a1b028-2351-7605-96d5-b39a1ad9df0f": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"01a1b028-2359-72bc-add8-a22020ccf80a": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"01a1b028-2361-71b8-b4bd-4227e8de54bc": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||
"01a1b028-2369-7670-9824-9c1871789b60": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:21:32Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"exit_code": 1,
|
||||
"wall_seconds": 2.32,
|
||||
"stdout": "",
|
||||
"log": [
|
||||
"{\"error\":\"EndpointConnectionError\",\"event\":\"reconcile.failed\",\"level\":\"error\",\"ts\":\"2026-11-06T09:21:25.233096Z\"}"
|
||||
]
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:21:22Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"s3": "paused",
|
||||
"state_before_stop": "running",
|
||||
"init": "true",
|
||||
"stop_seconds": 0.1,
|
||||
"exit_code": 143,
|
||||
"next_pass_skipped": false
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
{
|
||||
"date": "2026-11-06T09:23:59Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"seconds": 75,
|
||||
"upload_threads": 3,
|
||||
"uploads": {
|
||||
"201": 3364
|
||||
},
|
||||
"created": 3364,
|
||||
"linked_every": 10,
|
||||
"reconciler_runs": 59,
|
||||
"run_seconds": [
|
||||
0.055,
|
||||
0.048,
|
||||
0.056,
|
||||
0.057,
|
||||
0.063,
|
||||
0.067,
|
||||
0.078,
|
||||
0.082,
|
||||
0.094,
|
||||
0.093,
|
||||
0.097,
|
||||
0.102,
|
||||
0.116,
|
||||
0.144,
|
||||
0.125,
|
||||
0.131,
|
||||
0.127,
|
||||
0.15,
|
||||
0.137,
|
||||
0.155,
|
||||
0.163,
|
||||
0.161,
|
||||
0.168,
|
||||
0.183,
|
||||
0.171,
|
||||
0.177,
|
||||
0.176,
|
||||
0.195,
|
||||
0.208,
|
||||
0.197,
|
||||
0.212,
|
||||
0.217,
|
||||
0.221,
|
||||
0.222,
|
||||
0.246,
|
||||
0.236,
|
||||
0.248,
|
||||
0.247,
|
||||
0.257,
|
||||
0.277,
|
||||
0.262,
|
||||
0.3,
|
||||
0.305,
|
||||
0.289,
|
||||
0.299,
|
||||
0.297,
|
||||
0.302,
|
||||
0.358,
|
||||
0.325,
|
||||
0.325,
|
||||
0.333,
|
||||
0.352,
|
||||
0.334,
|
||||
0.346,
|
||||
0.344,
|
||||
0.346,
|
||||
0.384,
|
||||
0.38,
|
||||
0.406
|
||||
],
|
||||
"fixed_total": {
|
||||
"orphan_stale": 5,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 5
|
||||
},
|
||||
"fresh_seen_total": {
|
||||
"orphan_fresh": 175,
|
||||
"pending_fresh": 42
|
||||
},
|
||||
"rechecked_total": {
|
||||
"missing": 55
|
||||
},
|
||||
"errors": 0,
|
||||
"skipped": 0,
|
||||
"injected_before_load": {
|
||||
"orphan": 3,
|
||||
"pending_stale": 3
|
||||
},
|
||||
"left_from_faults": {
|
||||
"orphan_stale": 2,
|
||||
"pending_stale": 2
|
||||
},
|
||||
"check_after": {
|
||||
"objects": 3382,
|
||||
"rows": 3383,
|
||||
"ready_healthy": 3375,
|
||||
"counts": {
|
||||
"orphan_stale": 0,
|
||||
"orphan_fresh": 0,
|
||||
"missing_referenced": 0,
|
||||
"missing_unreferenced": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale_with_object": 0,
|
||||
"pending_stale_without_object": 0,
|
||||
"pending_fresh": 0,
|
||||
"quarantined": 8,
|
||||
"incomplete_stale": 0,
|
||||
"incomplete_fresh": 0,
|
||||
"lost_ready": 0
|
||||
},
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
date: 2026-11-06T09:23:59Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-reconcile-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:hlpipe-lab4-forward-final-20261106"}
|
||||
$ make down
|
||||
docker compose --profile bench --profile tools --profile reconcile down
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-lb-1 Stopping
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-2 Stopping
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-1 Stopping
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-lb-1 Stopped
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-lb-1 Removing
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-lb-1 Removed
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-1 Stopped
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-1 Removing
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-1 Removed
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-2 Stopped
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-2 Removing
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-2 Removed
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Stopping
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Stopping
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-valkey-1 Stopping
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Stopped
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Removing
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Stopped
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Removing
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Removed
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Stopping
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Removed
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Stopping
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Stopped
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Removing
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Stopped
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Removing
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Removed
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-valkey-1 Stopped
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-valkey-1 Removing
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Removed
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-valkey-1 Removed
|
||||
Network hlpipe-lab4-forward-reconcile-20261106_edge Removing
|
||||
Network hlpipe-lab4-forward-reconcile-20261106_backend Removing
|
||||
Network hlpipe-lab4-forward-reconcile-20261106_edge Removed
|
||||
Network hlpipe-lab4-forward-reconcile-20261106_backend Removed
|
||||
exit_code: 0 elapsed_seconds: 3.396
|
||||
@@ -1,6 +0,0 @@
|
||||
date: 2026-11-06T09:19:41Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-reconcile-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:hlpipe-lab4-forward-final-20261106"}
|
||||
$ 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.
|
||||
exit_code: 0 elapsed_seconds: 0.460
|
||||
@@ -1,149 +0,0 @@
|
||||
date: 2026-11-06T09:19:28Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-reconcile-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:hlpipe-lab4-forward-final-20261106"}
|
||||
$ make up
|
||||
sh scripts/secrets.sh
|
||||
docker compose up -d --build --wait
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 453B done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 1.65kB done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [internal] load metadata for ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [internal] load metadata for docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#4 DONE 1.4s
|
||||
|
||||
#5 [internal] load .dockerignore
|
||||
#5 transferring context: 453B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 FROM ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#6 resolve ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 done
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 [builder 1/7] FROM docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#7 resolve docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d done
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [internal] load build context
|
||||
#8 transferring context: 18.81kB 0.0s done
|
||||
#8 DONE 0.1s
|
||||
|
||||
#9 [runtime 5/6] COPY --chown=root:root alembic.ini ./
|
||||
#9 CACHED
|
||||
|
||||
#10 [builder 2/7] COPY --from=ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /usr/local/bin/uv
|
||||
#10 CACHED
|
||||
|
||||
#11 [builder 7/7] RUN uv sync --locked --no-dev --no-editable
|
||||
#11 CACHED
|
||||
|
||||
#12 [runtime 3/6] COPY --from=builder --chown=root:root /opt/venv /opt/venv
|
||||
#12 CACHED
|
||||
|
||||
#13 [builder 3/7] WORKDIR /build
|
||||
#13 CACHED
|
||||
|
||||
#14 [builder 5/7] RUN uv sync --locked --no-dev --no-install-project --no-editable
|
||||
#14 CACHED
|
||||
|
||||
#15 [builder 4/7] COPY pyproject.toml uv.lock README.md ./
|
||||
#15 CACHED
|
||||
|
||||
#16 [builder 6/7] COPY src ./src
|
||||
#16 CACHED
|
||||
|
||||
#17 [runtime 2/6] RUN groupadd --system --gid 10001 messenger && useradd --system --uid 10001 --gid messenger --no-create-home --shell /usr/sbin/nologin messenger
|
||||
#17 CACHED
|
||||
|
||||
#18 [runtime 4/6] WORKDIR /app
|
||||
#18 CACHED
|
||||
|
||||
#19 [runtime 6/6] COPY --chown=root:root alembic ./alembic
|
||||
#19 CACHED
|
||||
|
||||
#20 exporting to image
|
||||
#20 exporting layers done
|
||||
#20 exporting manifest sha256:3eab4c0213dac6c3abf99f1aae3241f7f05473144ea0af93cbd54f2493ead5a9 done
|
||||
#20 exporting config sha256:69a1b793a45421608110feaeff33be9ffc032aef2a7543216961693aaea7a897 done
|
||||
#20 exporting attestation manifest sha256:3a5615e55b30f4fcea966479882ce9f7b5226b07b170e3c3b9c58831718ace92 done
|
||||
#20 exporting manifest list sha256:0a338d6793692cb6388d9855a4ea5fa5f4a7fce70c493d6ffdb8e1330147011d done
|
||||
#20 naming to docker.io/library/mtusi-messenger:hlpipe-lab4-forward-final-20261106 done
|
||||
#20 unpacking to docker.io/library/mtusi-messenger:hlpipe-lab4-forward-final-20261106 done
|
||||
#20 DONE 0.0s
|
||||
|
||||
#21 resolving provenance for metadata file
|
||||
#21 DONE 0.0s
|
||||
api Built
|
||||
Network hlpipe-lab4-forward-reconcile-20261106_backend Creating
|
||||
Network hlpipe-lab4-forward-reconcile-20261106_backend Created
|
||||
Network hlpipe-lab4-forward-reconcile-20261106_edge Creating
|
||||
Network hlpipe-lab4-forward-reconcile-20261106_edge Created
|
||||
Volume "hlpipe-lab4-forward-reconcile-20261106_pgdata" Creating
|
||||
Volume "hlpipe-lab4-forward-reconcile-20261106_pgdata" Created
|
||||
Volume "hlpipe-lab4-forward-reconcile-20261106_s3data" Creating
|
||||
Volume "hlpipe-lab4-forward-reconcile-20261106_s3data" Created
|
||||
Volume "hlpipe-lab4-forward-reconcile-20261106_valkeydata" Creating
|
||||
Volume "hlpipe-lab4-forward-reconcile-20261106_valkeydata" Created
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-valkey-1 Creating
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Creating
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Creating
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-lb-1 Creating
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-valkey-1 Created
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Created
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Creating
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-lb-1 Created
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Created
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Creating
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Created
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Created
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-2 Creating
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-1 Creating
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-2 Created
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-1 Created
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-valkey-1 Starting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-lb-1 Starting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Starting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Starting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-valkey-1 Started
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Started
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Started
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-lb-1 Started
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Healthy
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Starting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Started
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Healthy
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Starting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Started
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Exited
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Exited
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-1 Starting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-1 Started
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-2 Starting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-2 Started
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-lb-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-valkey-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-2 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Waiting
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-1 Healthy
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-migrate-1 Exited
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-valkey-1 Healthy
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-postgres-1 Healthy
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-s3-init-1 Exited
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-1 Healthy
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-api-2 Healthy
|
||||
Container hlpipe-lab4-forward-reconcile-20261106-lb-1 Healthy
|
||||
scripts/lb-wait.sh
|
||||
exit_code: 0 elapsed_seconds: 12.779
|
||||
@@ -1,12 +0,0 @@
|
||||
date: 2026-11-06T09:14:46Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1", "API_IMAGE": "mtusi-messenger:hlpipe-lab4-forward-final-20261106"}
|
||||
$ make restore
|
||||
scripts/restore.sh
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Running
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Healthy
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Healthy
|
||||
exit_code: 0 elapsed_seconds: 2.582
|
||||
@@ -1,13 +0,0 @@
|
||||
date: 2026-11-06T09:10:56Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {}
|
||||
$ python3 -c 'import subprocess
|
||||
from pathlib import Path
|
||||
paths=["src/messenger/attachments", "src/messenger/shared", "scripts/reconcile_track.py", "student-tests/tools/seed_storage.py", "alembic", "compose.yaml", "Dockerfile", "pyproject.toml", "uv.lock"]
|
||||
subprocess.run(["git", "diff", "--exit-code", "d7478726a85791c21e065d58f610735a9e687433", "--", *paths],check=True)
|
||||
print("PASS: reconciler algorithm, entrypoint, attachment SQL/S3, platform, schema, dependencies and cost driver unchanged")
|
||||
print("Retained 27 measurements: evidence/sqlalchemy-2026-11-06/track5/measurements/cost, source runtime 3402fd69d4922e500035a204d957be2cccaeb85a")
|
||||
print("Cache miss/logout, NUL validation and LB JSON are outside the measured cost path; API/LB/Valkey were stopped during that series")'
|
||||
PASS: reconciler algorithm, entrypoint, attachment SQL/S3, platform, schema, dependencies and cost driver unchanged
|
||||
Retained 27 measurements: evidence/sqlalchemy-2026-11-06/track5/measurements/cost, source runtime 3402fd69d4922e500035a204d957be2cccaeb85a
|
||||
Cache miss/logout, NUL validation and LB JSON are outside the measured cost path; API/LB/Valkey were stopped during that series
|
||||
exit_code: 0 elapsed_seconds: 0.036
|
||||
@@ -1,54 +0,0 @@
|
||||
date: 2026-11-06T09:13:32Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ python3 scripts/lab4_scenarios.py s3-outage --base-url http://127.0.0.1:18084 --output evidence/forward-final-2026-11-06/s3-outage.json
|
||||
{
|
||||
"ok": true,
|
||||
"date": "2026-11-06T09:13:32Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"scenario": "s3-outage",
|
||||
"s3_container_during_outage": [
|
||||
{
|
||||
"hostname": "5921e788f03d",
|
||||
"status": "exited",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:12:21.141692594Z",
|
||||
"finished_at": "2026-11-06T09:13:33.012881918Z"
|
||||
}
|
||||
],
|
||||
"during_outage": {
|
||||
"upload": {
|
||||
"status": 503,
|
||||
"seconds": 4.99,
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
"metadata": {
|
||||
"status": 200,
|
||||
"seconds": 0.026,
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
"download": {
|
||||
"status": 503,
|
||||
"seconds": 5.329,
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
"text_message": {
|
||||
"status": 201,
|
||||
"seconds": 0.033,
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
"health_ready": {
|
||||
"status": 200,
|
||||
"seconds": 0.003,
|
||||
"instance": "da922ab2ea09"
|
||||
}
|
||||
},
|
||||
"expected": {
|
||||
"upload": 503,
|
||||
"download": 503,
|
||||
"text_message": 201
|
||||
},
|
||||
"as_expected": true,
|
||||
"s3_back_healthy_seconds": 5.76,
|
||||
"download_after_recovery": "sha256 equal"
|
||||
}
|
||||
exit_code: 0 elapsed_seconds: 16.753
|
||||
@@ -1,50 +0,0 @@
|
||||
{
|
||||
"ok": true,
|
||||
"date": "2026-11-06T09:13:32Z",
|
||||
"commit": "75b93bbba5f29575d3fca1d013cc7e0770d88082",
|
||||
"scenario": "s3-outage",
|
||||
"s3_container_during_outage": [
|
||||
{
|
||||
"hostname": "5921e788f03d",
|
||||
"status": "exited",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:12:21.141692594Z",
|
||||
"finished_at": "2026-11-06T09:13:33.012881918Z"
|
||||
}
|
||||
],
|
||||
"during_outage": {
|
||||
"upload": {
|
||||
"status": 503,
|
||||
"seconds": 4.99,
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
"metadata": {
|
||||
"status": 200,
|
||||
"seconds": 0.026,
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
"download": {
|
||||
"status": 503,
|
||||
"seconds": 5.329,
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
"text_message": {
|
||||
"status": 201,
|
||||
"seconds": 0.033,
|
||||
"instance": "da922ab2ea09"
|
||||
},
|
||||
"health_ready": {
|
||||
"status": 200,
|
||||
"seconds": 0.003,
|
||||
"instance": "da922ab2ea09"
|
||||
}
|
||||
},
|
||||
"expected": {
|
||||
"upload": 503,
|
||||
"download": 503,
|
||||
"text_message": 201
|
||||
},
|
||||
"as_expected": true,
|
||||
"s3_back_healthy_seconds": 5.76,
|
||||
"download_after_recovery": "sha256 equal"
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
date: 2026-11-06T09:26:56Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {}
|
||||
$ python3 -
|
||||
{"project": "hlpipe-lab4-forward-final-20261106", "containers": [], "persistent_volumes": ["hlpipe-lab4-forward-final-20261106_pgdata", "hlpipe-lab4-forward-final-20261106_s3data", "hlpipe-lab4-forward-final-20261106_valkeydata"]}
|
||||
{"project": "hlpipe-lab4-forward-reconcile-20261106", "containers": [], "persistent_volumes": ["hlpipe-lab4-forward-reconcile-20261106_pgdata", "hlpipe-lab4-forward-reconcile-20261106_s3data", "hlpipe-lab4-forward-reconcile-20261106_valkeydata"]}
|
||||
{"project": "hlpipe-lab4-forward-lb-20261106", "containers": [], "persistent_volumes": []}
|
||||
PASS: all owned containers stopped; six persistent volumes retained
|
||||
exit_code: 0 elapsed_seconds: 0.152
|
||||
@@ -1,6 +0,0 @@
|
||||
date: 2026-11-06T09:09:22Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ 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.
|
||||
exit_code: 0 elapsed_seconds: 0.534
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,114 +0,0 @@
|
||||
date: 2026-11-06T09:10:42Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ make test-faults
|
||||
BASE_URL="http://127.0.0.1:18084" .venv/bin/pytest -m stack -v -s student-tests/stack
|
||||
============================= test session starts ==============================
|
||||
platform darwin -- Python 3.14.5, pytest-9.1.1, pluggy-1.6.0 -- <repo>/.venv/bin/python
|
||||
cachedir: .pytest_cache
|
||||
rootdir: <repo>
|
||||
configfile: pyproject.toml
|
||||
plugins: asyncio-1.4.0, anyio-4.15.1
|
||||
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
|
||||
collecting ... collected 19 items
|
||||
|
||||
student-tests/stack/test_attachment_faults.py::test_user_errors_never_become_500 10 MiB + 1 с Content-Length, тело не отправлено: 413
|
||||
10 MiB + 1 chunked: 413
|
||||
PNG 100000×100000 (бомба): 413
|
||||
PNG 8001×5000: 413
|
||||
обрезанный PNG: 415
|
||||
обрезанный JPEG: 415
|
||||
JPEG как image/png: 415
|
||||
GIF как image/png: 415
|
||||
WebP как image/png: 415
|
||||
текст как image/png: 415
|
||||
PNG как image/jpeg: 415
|
||||
пустое тело: 415
|
||||
application/octet-stream: 415
|
||||
без Content-Type: 415
|
||||
filename='../a.png': 400
|
||||
filename='a/b.png': 400
|
||||
filename='a\\b.png': 400
|
||||
filename='a\x00.png': 400
|
||||
filename='a\x01.png': 400
|
||||
filename='a\x7f.png': 400
|
||||
filename='': 400
|
||||
filename=' ': 400
|
||||
filename='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: 400
|
||||
filename=None: 400
|
||||
посторонний: upload в чужой чат: 404
|
||||
посторонний: метаданные: 404
|
||||
посторонний: /content: 404
|
||||
посторонний: ссылка на чужое вложение: 404
|
||||
вложение другого чата: 404
|
||||
неизвестное вложение: 404
|
||||
11 вложений: 400
|
||||
повтор вложения: 400
|
||||
невалидный UUID: 400
|
||||
пустой текст без вложений: 400
|
||||
невалидный id вложения: 400
|
||||
variant=thumbnail: 400
|
||||
строк вложений в чате: 2 (= ответов 201); ответов в журнале реплик: 112, из них 5xx: 0
|
||||
PASSED
|
||||
student-tests/stack/test_attachment_faults.py::test_commit_failure_is_compensated_at_once отказ COMMIT после записи объекта: 503 unavailable
|
||||
сразу после ответа: строка нет, объект HEAD 404
|
||||
журнал: audit.attachment_discarded reason=compensation
|
||||
PASSED
|
||||
student-tests/stack/test_attachment_faults.py::test_crash_between_put_and_commit_is_swept_after_grace реплика da922ab2ea09 убита между PUT и COMMIT, клиент получил 502
|
||||
реплика d4c8d53d7433 убита между PUT и COMMIT, клиент получил 502
|
||||
остаток после падения: строка pending, объект HEAD 200
|
||||
остаток после падения: строка pending, объект HEAD 200
|
||||
старше grace: строка убрана через 26.1 с, объект HEAD 404
|
||||
моложе grace: строка pending, объект HEAD 200
|
||||
тот же после сдвига: убран через 1.5 с, объект HEAD 404
|
||||
готовое вложение в сообщении со сдвинутым created_at скачивается, SHA-256 совпадает
|
||||
PASSED
|
||||
student-tests/stack/test_attachment_faults.py::test_aborted_upload_leaves_nothing обрыв после 256 KiB из 5 MiB: статус в журнале реплики [400], намерение None
|
||||
PASSED
|
||||
student-tests/stack/test_attachment_faults.py::test_stalled_upload_is_cut_and_leaves_nothing тело зависло после 1 KiB: 503 unavailable за 8.02 с
|
||||
PASSED
|
||||
student-tests/stack/test_attachment_faults.py::test_token_is_checked_before_the_declared_size без токена, Content-Length 10485761: 401 unauthorized
|
||||
PASSED
|
||||
student-tests/stack/test_attachment_faults.py::test_slow_but_steady_transfers_outlive_the_request_timeout upload 3 MiB ≈ 256 KiB/s: клиент 12.3 с, реплика (201, 12.061776)
|
||||
скачивание 3 MiB ≈ 192 KiB/s из сети edge: клиент 16.1 с, реплика (200, 10.474701)
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_registration_race_yields_exactly_one_user гонка 50 регистраций: 201×1, 409×49
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_chat_creation_rolls_back_on_unknown_member чат с несуществующим участником: 400 invalid_request
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_wrong_password_and_unknown_user_get_same_basic_challenge неверный пароль: 401 за 0.014 с
|
||||
неизвестный пользователь: 401 за 0.013 с
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_logout_then_token_is_dead logout: 204, затем 401, повтор 401
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_valkey_serves_repeated_checks 5 проверок токена: keyspace_hits 294 → 299
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_valkey_stopped_is_bypassed_but_logout_waits valkey остановлен, действующий токен: 200 за 0.005 с
|
||||
valkey остановлен, неизвестный токен: 401 за 0.003 с
|
||||
valkey остановлен: ready 200, вход 201, выход 503
|
||||
valkey снова запущен: повторный выход 204
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_valkey_restart_keeps_cache_and_revocations рестарт valkey: ключей 31 → 31
|
||||
рестарт valkey: живой 200, отозванный 401
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_valkey_flushall_loses_nothing FLUSHALL: живой 200, отозванный 401
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_postgres_stopped_gives_bounded_503_and_recovers postgres остановлен, ready: 503 за 0.004 с
|
||||
postgres остановлен, me: 503 за 0.003 с
|
||||
postgres остановлен, stranger: 503 за 0.003 с
|
||||
postgres остановлен, login: 503 за 0.002 с
|
||||
postgres остановлен, register: 503 за 0.015 с
|
||||
live внутри реплики 200; LB исключил все реплики ещё через 0.68 с
|
||||
live через LB без реплик: 503 за 0.000 с
|
||||
postgres запущен: готовность через 2.1 с, прежний токен 200
|
||||
postgres запущен: 40 регистраций 201 через 2 реплики без рестарта API
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_api_restart_keeps_session_without_extending_it рестарт api: готовность через 1.8 с, токен 200
|
||||
expires_at при входе 2026-11-06T10:12:13.154076Z, в БД после рестарта 2026-11-06T10:12:13.154076Z
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_full_restart_keeps_session_until_logout restart.sh: готовность через 0.0 с, прежний токен 200, выход 204, затем 401
|
||||
PASSED
|
||||
student-tests/stack/test_faults.py::test_session_expires_after_restart_at_original_time срок сессии сокращён до 20 с, рестарт api: готовность через 2.8 с, до срока 200, после срока 401
|
||||
PASSED
|
||||
|
||||
======================== 19 passed in 128.23s (0:02:08) ========================
|
||||
exit_code: 0 elapsed_seconds: 128.882
|
||||
@@ -1,159 +0,0 @@
|
||||
date: 2026-11-06T09:09:05Z commit: 75b93bbba5f29575d3fca1d013cc7e0770d88082
|
||||
environment: {"COMPOSE_PROJECT_NAME": "hlpipe-lab4-forward-final-20261106", "COMPOSE_FILE": "compose.yaml", "LB_HTTP_PORT": "18084", "LB_STATS_PORT": "24844", "BASE_URL": "http://127.0.0.1:18084", "EVIDENCE_DIR": "evidence/forward-final-2026-11-06", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ make up
|
||||
sh scripts/secrets.sh
|
||||
docker compose up -d --build --wait
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 453B done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 1.65kB done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [internal] load metadata for docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [internal] load metadata for ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [internal] load .dockerignore
|
||||
#5 transferring context: 453B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [builder 1/7] FROM docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#6 resolve docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d 0.0s done
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 FROM ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#7 resolve ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 0.0s done
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [internal] load build context
|
||||
#8 transferring context: 88.06kB 0.0s done
|
||||
#8 DONE 0.0s
|
||||
|
||||
#9 [builder 4/7] COPY pyproject.toml uv.lock README.md ./
|
||||
#9 CACHED
|
||||
|
||||
#10 [builder 2/7] COPY --from=ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /usr/local/bin/uv
|
||||
#10 CACHED
|
||||
|
||||
#11 [builder 3/7] WORKDIR /build
|
||||
#11 CACHED
|
||||
|
||||
#12 [builder 5/7] RUN uv sync --locked --no-dev --no-install-project --no-editable
|
||||
#12 CACHED
|
||||
|
||||
#13 [builder 6/7] COPY src ./src
|
||||
#13 DONE 0.0s
|
||||
|
||||
#14 [builder 7/7] RUN uv sync --locked --no-dev --no-editable
|
||||
#14 0.197 Resolved 78 packages in 10ms
|
||||
#14 0.217 Building mtusi-messenger @ file:///build
|
||||
#14 1.666 Built mtusi-messenger @ file:///build
|
||||
#14 1.670 Prepared 1 package in 1.45s
|
||||
#14 1.673 Installed 1 package in 2ms
|
||||
#14 1.842 Bytecode compiled 1701 files in 169ms
|
||||
#14 1.842 + mtusi-messenger==1.4.0 (from file:///build)
|
||||
#14 DONE 1.9s
|
||||
|
||||
#15 [runtime 2/6] RUN groupadd --system --gid 10001 messenger && useradd --system --uid 10001 --gid messenger --no-create-home --shell /usr/sbin/nologin messenger
|
||||
#15 CACHED
|
||||
|
||||
#16 [runtime 3/6] COPY --from=builder --chown=root:root /opt/venv /opt/venv
|
||||
#16 DONE 0.3s
|
||||
|
||||
#17 [runtime 4/6] WORKDIR /app
|
||||
#17 DONE 0.0s
|
||||
|
||||
#18 [runtime 5/6] COPY --chown=root:root alembic.ini ./
|
||||
#18 DONE 0.0s
|
||||
|
||||
#19 [runtime 6/6] COPY --chown=root:root alembic ./alembic
|
||||
#19 DONE 0.0s
|
||||
|
||||
#20 exporting to image
|
||||
#20 exporting layers
|
||||
#20 exporting layers 2.8s done
|
||||
#20 exporting manifest sha256:3eab4c0213dac6c3abf99f1aae3241f7f05473144ea0af93cbd54f2493ead5a9
|
||||
#20 exporting manifest sha256:3eab4c0213dac6c3abf99f1aae3241f7f05473144ea0af93cbd54f2493ead5a9 done
|
||||
#20 exporting config sha256:69a1b793a45421608110feaeff33be9ffc032aef2a7543216961693aaea7a897 done
|
||||
#20 exporting attestation manifest sha256:e1e89c5d35d917ea80fcbc1233c1a97c191fa11007c9414c3a1d5cc89429fc08 done
|
||||
#20 exporting manifest list sha256:085f71679218b524f710c1da526f25cbe81073ef1fc01430e842d8b59369bd28 done
|
||||
#20 naming to docker.io/library/mtusi-messenger:hlpipe-lab4-forward-final-20261106 done
|
||||
#20 unpacking to docker.io/library/mtusi-messenger:hlpipe-lab4-forward-final-20261106
|
||||
#20 unpacking to docker.io/library/mtusi-messenger:hlpipe-lab4-forward-final-20261106 0.6s done
|
||||
#20 DONE 3.4s
|
||||
|
||||
#21 resolving provenance for metadata file
|
||||
#21 DONE 0.0s
|
||||
api Built
|
||||
Network hlpipe-lab4-forward-final-20261106_backend Creating
|
||||
Network hlpipe-lab4-forward-final-20261106_backend Created
|
||||
Network hlpipe-lab4-forward-final-20261106_edge Creating
|
||||
Network hlpipe-lab4-forward-final-20261106_edge Created
|
||||
Volume "hlpipe-lab4-forward-final-20261106_s3data" Creating
|
||||
Volume "hlpipe-lab4-forward-final-20261106_s3data" Created
|
||||
Volume "hlpipe-lab4-forward-final-20261106_pgdata" Creating
|
||||
Volume "hlpipe-lab4-forward-final-20261106_pgdata" Created
|
||||
Volume "hlpipe-lab4-forward-final-20261106_valkeydata" Creating
|
||||
Volume "hlpipe-lab4-forward-final-20261106_valkeydata" Created
|
||||
Container hlpipe-lab4-forward-final-20261106-valkey-1 Creating
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Creating
|
||||
Container hlpipe-lab4-forward-final-20261106-lb-1 Creating
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Creating
|
||||
Container hlpipe-lab4-forward-final-20261106-valkey-1 Created
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Created
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Creating
|
||||
Container hlpipe-lab4-forward-final-20261106-lb-1 Created
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Created
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Creating
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Created
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Created
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Creating
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Creating
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Created
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Created
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-lb-1 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-valkey-1 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-valkey-1 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-lb-1 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Healthy
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Healthy
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Exited
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Exited
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Starting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Started
|
||||
Container hlpipe-lab4-forward-final-20261106-valkey-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-lb-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Waiting
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-1 Healthy
|
||||
Container hlpipe-lab4-forward-final-20261106-migrate-1 Exited
|
||||
Container hlpipe-lab4-forward-final-20261106-postgres-1 Healthy
|
||||
Container hlpipe-lab4-forward-final-20261106-s3-init-1 Exited
|
||||
Container hlpipe-lab4-forward-final-20261106-valkey-1 Healthy
|
||||
Container hlpipe-lab4-forward-final-20261106-api-1 Healthy
|
||||
Container hlpipe-lab4-forward-final-20261106-api-2 Healthy
|
||||
Container hlpipe-lab4-forward-final-20261106-lb-1 Healthy
|
||||
scripts/lb-wait.sh
|
||||
exit_code: 0 elapsed_seconds: 17.380
|
||||
@@ -1,186 +0,0 @@
|
||||
# Поздний перенос ЛР3 → ЛР4
|
||||
|
||||
Это протокол **до двух PNG-фиксов**. «Новый/текущий» ниже означает состояние переноса
|
||||
`75b93bb…`, а не итоговый HEAD. Память и upload во время reconciler требуют финального
|
||||
подтверждения нового инспектора; неизменённая стоимость reconciler сохраняется.
|
||||
Актуальная область доказательств — [индекс](README.md) и [REPORT](../REPORT.md).
|
||||
|
||||
Исходный source SHA: `f591fa64e525679a31c9db7f942d36c789e1a12f`.
|
||||
Финальный source SHA: `ba78cf6da439a4ec60fd59389583b38285b0b2b1`.
|
||||
Источник только immutable snapshot `lab3-ba78cf6da439a4ec60fd59389583b38285b0b2b1`
|
||||
в `.pipeline/.runs/labs/snapshots/`; изменяемый каталог ЛР3 не использован.
|
||||
База ЛР4: `d7478726a85791c21e065d58f610735a9e687433`, чистое дерево до начала.
|
||||
План зафиксирован в `f0fc084`; change `forward-lab3-final-review-fixes`.
|
||||
Код и инструменты проверок зафиксированы в `75b93bbba5f29575d3fca1d013cc7e0770d88082`.
|
||||
Все успешные новые runtime-проверки ниже выполнены на этом SHA 6 ноября 2026 года (UTC).
|
||||
|
||||
Полный список всех 214 изменённых файлов, их source blob и решение для каждого:
|
||||
[manifest](forward-final-2026-11-06/source-manifest.json). Неучтённых путей нет.
|
||||
[Проверка диапазона и source blob](forward-final-2026-11-06/forward-audit.txt) подтверждает
|
||||
214 путей и побайтное совпадение 31 перенесённого файла; два файла объединены вручную.
|
||||
|
||||
## Применимые исправления
|
||||
|
||||
| Источник | Файлы ЛР4 | Решение |
|
||||
| --- | --- | --- |
|
||||
| `2af24d7`: отзыв сессии и потеря кэша | identity/application/handlers.py; identity/infrastructure/postgres.py, valkey.py | DELETE в транзакции до инвалидации, FOR KEY SHARE при cache miss, nonce reservation и атомарные Lua. Закрывает возврат отозванного токена при flush/evict/replacement и до COMMIT. |
|
||||
| `2af24d7`: JSON ошибок LB | infra/haproxy/haproxy.cfg | json(ascii) для поля request_id в 502/503/504; заголовок сохранён. Буферы, таймауты и политика POST/upload ЛР4 не затронуты. |
|
||||
| `e66e2d7`: NUL | identity/domain/values.py; identity/entrypoints/authentication.py; messaging/domain/values.py | Отклонение до SQL, 400 для display_name/title/text, 401 для Basic username. MessageText вручную объединён: text="" с вложением по-прежнему допустим. |
|
||||
| `7e19d4e`: non-ASCII Basic | identity/entrypoints/authentication.py | Проверка encoded.isascii до Base64, одинаковый 401 вместо 500. |
|
||||
| Регрессии источника | student-tests/api/test_cache.py, test_sessions.py, test_nul_validation.py; unit/test_authentication.py, test_haproxy_errors.py, test_nul_inputs.py, test_session_cache.py | Перенесены все 7 файлов; проверяют гонки, rollback, TTL, NUL, malformed Basic и JSON ошибок. |
|
||||
| Переносимые сценарии внутри source evidence | student-tests/tools/forward_network.py, tools/lb_errors/ | Сценарии выполняются заново; изменены порт/образ/project, сервер fixture использует stdlib socketserver. Исходное сырьё не скопировано как результат ЛР4. |
|
||||
| OpenSpec | 6 исходных capabilities; 3 source archives (19 файлов) | Дельты применяются к прежним префиксам. В history сохранены все сценарии attachment_ids. Архивы ЛР3 сохранены побайтно с lab:3, это история источника, не проверки ЛР4. |
|
||||
| Контекст | AGENTS.md, openspec/config.yaml | Переносимые правила provenance/Context7/сохранения evidence адаптированы к ЛР4 и текущему правилу major/minor. |
|
||||
|
||||
Пять файлов Identity и существовавшие тестовые файлы совпали с базой f591fa6 до переноса;
|
||||
они и новые тесты взяты из final snapshot целиком. Два файла с механизмами ЛР4 объединены вручную.
|
||||
SQLAlchemy/Alembic остаются обязательными; новых миграций или зависимостей в диапазоне нет.
|
||||
Учтены 14 файлов кода/тестов, 19 файлов архивов, 6 capabilities, 2 файла контекста,
|
||||
4 инструмента из evidence и 169 непереносимых файлов отчёта/результатов: всего 214.
|
||||
|
||||
## Неприменимые изменения
|
||||
|
||||
169 файлов REPORT/evidence ЛР3 не скопированы: это чужой для ЛР4 отчёт, результаты
|
||||
трёхуровневой матрицы масштабирования и аудиты конкретных образов/стендов ЛР3.
|
||||
Их цифры не доказывают ЛР4. Четыре переносимых файла сценариев выделены отдельно выше.
|
||||
AGENTS/config: статусы 135 измерений ЛР3, порты 18083/23083, трек масштабирования,
|
||||
ограничения отдельной report-фазы не заменяют контекст текущей ЛР4. Применимые
|
||||
правила перенесены с портами 18084/24000–24999 и актуальным порядком runner.
|
||||
Нормативные contracts/tests/README/COURSE, secrets/.env/volumes не переносились.
|
||||
Source REPORT содержит minor про суррогаты; он сохраняется как ограничение, а не исправление.
|
||||
|
||||
## Проверки и применимость измерений
|
||||
|
||||
Новые команды, UTC и полные SHA сохранены в `forward-final-2026-11-06/`.
|
||||
Основной project — `hlpipe-lab4-forward-final-20261106`, HTTP `18084`, статистика
|
||||
`24844`, образ `mtusi-messenger:hlpipe-lab4-forward-final-20261106`.
|
||||
Demo использует тот же образ в отдельном `hlpipe-lab4-forward-reconcile-20261106`;
|
||||
fixture HAProxy — `hlpipe-lab4-forward-lb-20261106`, без host-портов.
|
||||
Каждый project создан в текущем репозитории со своими volumes, старые данные не удалены.
|
||||
|
||||
| Критерий / команда | Наблюдение | Сырьё |
|
||||
| --- | --- | --- |
|
||||
| `make check`, `make validate`, `make lint`, `make student-test` | PASS; 492 собственных теста, 19 stack deselected. Регрессии гонок используют реальные PostgreSQL/Valkey; прежние тесты вложений и миграций сохранены. | [offline-checks-rerun.txt](forward-final-2026-11-06/offline-checks-rerun.txt) |
|
||||
| Уровень 3: `make up`, `make test` | Обе реплики healthy; checksum, авторизация, сообщения с вложениями — PASS. | [up.txt](forward-final-2026-11-06/up.txt), [smoke.txt](forward-final-2026-11-06/smoke.txt) |
|
||||
| Уровень 3: `scripts/persistence-evidence.sh http://127.0.0.1:18084` | PASS после рестарта API/LB/PostgreSQL/Valkey/S3 с volumes, 13,179 с. | [persistence-rerun.txt](forward-final-2026-11-06/persistence-rerun.txt) |
|
||||
| Уровень 3: `make test-failover ACTION_SCRIPT=scripts/stop-one.sh` | Остановлена `d4c8d53d7433`; 130 записей, 0 ошибок, первое восстановление 2,883 с. Реплики возвращены в ротацию. | [failover-command.txt](forward-final-2026-11-06/failover-command.txt), [failover-d4c8d53d7433.txt](forward-final-2026-11-06/failover-d4c8d53d7433.txt), [restore.txt](forward-final-2026-11-06/restore.txt) |
|
||||
| Сетевая регрессия: `student-tests/tools/forward_network.py` | NUL: display/title/text → 400, Basic → 401; non-ASCII Basic → 401. Исправленный повтор с прежним ключом → 201, одна запись; logout → 401 на обеих репликах. | [network-regressions.txt](forward-final-2026-11-06/network-regressions.txt) |
|
||||
| Уровни 3/4: `make test-faults` | 19 PASS за 128,23 с: PostgreSQL/Valkey, откат logout/TTL, 112 ответов негативного файлового suite без 5xx, компенсация между PUT/COMMIT, pending и grace, обрыв/зависание/медленное тело. | [stack-faults.txt](forward-final-2026-11-06/stack-faults.txt) |
|
||||
| Уровень 3: `make scenario SCENARIO=failover-upload` | Обслужившая upload реплика остановлена, download через другую; исходный SHA-256 совпал. | [failover-upload-command.txt](forward-final-2026-11-06/failover-upload-command.txt), [JSON](forward-final-2026-11-06/failover-upload.json) |
|
||||
| Уровень 3: `make scenario SCENARIO=s3-outage` | S3 остановлен: upload 503 за 4,990 с, download 503 за 5,329 с, текст 201, метаданные и ready 200. После старта байты совпали. | [s3-outage-command.txt](forward-final-2026-11-06/s3-outage-command.txt), [JSON](forward-final-2026-11-06/s3-outage.json) |
|
||||
| Минимум ЛР3: HAProxy fixture с текущей конфигурацией | 12 проверок: 502/503/504 × кавычка/backslash/tab/200 символов. Валидный JSON, request_id совпадает с заголовком. | [haproxy-errors.txt](forward-final-2026-11-06/haproxy-errors.txt) |
|
||||
| Уровень 4: `make limits` | Политика ресурсов, портов, credentials, volumes и сетей — PASS. | [limits.txt](forward-final-2026-11-06/limits.txt) |
|
||||
| После нагрузок: `make test` | PASS. | [final-smoke.txt](forward-final-2026-11-06/final-smoke.txt) |
|
||||
| Трек 2: `make reconcile-demo ARGS="--out evidence/forward-final-2026-11-06/reconcile-demo"` | 13 PASS; подробности ниже. | [reconcile-demo.txt](forward-final-2026-11-06/reconcile-demo.txt), [demo.json](forward-final-2026-11-06/reconcile-demo/demo.json) |
|
||||
|
||||
Ошибочные попытки сохранены: `offline-checks.txt` содержит две ошибки ty в адаптированном
|
||||
инструменте (проверки Optional/None исправлены до коммита кода); `persistence-command.txt`
|
||||
не передал URL обёртке и обратился к несуществующему localhost:8080 до запуска hook.
|
||||
Это не успешные проверки. Исправленные команды и результаты — в файлах с `-rerun` выше.
|
||||
|
||||
## Повтор затронутых измерений
|
||||
|
||||
Проверяемая гипотеза: после усиления проверки сессии сохраняются запись через обе реплики,
|
||||
ограниченная память крупных загрузок и отсутствие потери ready при параллельной сверке.
|
||||
API ×2, на реплику 1 CPU / 512 MiB / 2 worker, 3 upload-слота на worker,
|
||||
`MALLOC_MMAP_THRESHOLD_=131072`. Последовательные серии; одновременных нагрузочных серий нет.
|
||||
Docker VM: 16 CPU, 8 217 190 400 байт RAM. До/после видны только контейнеры текущего project;
|
||||
host load average 1m 3,42 → 4,69. Это наблюдение фона, не эксклюзивность физического хоста:
|
||||
[performance-before.txt](forward-final-2026-11-06/performance-before.txt),
|
||||
[performance-after.txt](forward-final-2026-11-06/performance-after.txt).
|
||||
Чужие контейнеры не останавливались, выброшенных прогонов нет.
|
||||
|
||||
`make load-evidence`: 3 × 8 с, 64 клиента, новый чат на прогон, пауза 15 с;
|
||||
клиент в сети edge с 2 CPU / 512 MiB. Это закрытый контур all-write, не SLO и не точка насыщения.
|
||||
Прогон с повторно используемым токеном не измеряет профиль постоянных cache miss;
|
||||
стоимость nonce/блокировки при массовом входе новых пользователей отдельно не измерена.
|
||||
|
||||
| Прогон | RPS | p95, мс | Ошибок |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| 1 | 1428,577 | 100,062 | 0 |
|
||||
| 2 | 1456,338 | 98,948 | 0 |
|
||||
| 3 | 1529,320 | 98,475 | 0 |
|
||||
|
||||
Медиана 1456,338 RPS, диапазон 1428,577–1529,320. Историческая SQLAlchemy-серия дала
|
||||
медиану 1529,186 RPS: наблюдаемая разница −4,8%, причинный эффект исправления по этим
|
||||
непарным сериям не установлен. Сырьё: [load-command.txt](forward-final-2026-11-06/load-command.txt),
|
||||
[load.txt](forward-final-2026-11-06/load.txt), [3 JSON](forward-final-2026-11-06/load/).
|
||||
|
||||
`python3 scripts/upload_memory.py --base-url http://127.0.0.1:18084 --slots 3
|
||||
--sizes 10485760 --levels 40 --out ...`: 40 клиентов, по 2 upload;
|
||||
размер созданного PNG 10 485 256 байт (параметр генератора 10 MiB).
|
||||
|
||||
| Прогон | HTTP | Пик API, MiB | Пик LB, MiB | Upload p95, мс | OOM |
|
||||
| --- | --- | ---: | ---: | ---: | ---: |
|
||||
| 1 | 80 × 201 | 456,2 | 31,8 | 3641,3 | 0 |
|
||||
| 2 | 80 × 201 | 438,1 | 28,5 | 4755,0 | 0 |
|
||||
| 3 | 78 × 201, 2 × 503 | 450,4 | 29,1 | 8091,8 | 0 |
|
||||
|
||||
238/240 успешны. Максимум API 456,2 < 512 MiB, медиана 450,4; LB медиана 29,1 MiB.
|
||||
Предел RAM соблюдён, но 100% успешности при 40 крупных параллельных upload не показано.
|
||||
Причина двух 503 отдельно не локализована; точка сохранена, повтор ради улучшения результата
|
||||
не делался. Отдельная уборка возможных остатков этих двух запросов в этой серии не измерялась.
|
||||
Сырьё: [memory-1.txt](forward-final-2026-11-06/memory-1.txt),
|
||||
[memory-2.txt](forward-final-2026-11-06/memory-2.txt),
|
||||
[memory-3.txt](forward-final-2026-11-06/memory-3.txt),
|
||||
[3 JSON](forward-final-2026-11-06/memory/).
|
||||
[Сводка из сырья](forward-final-2026-11-06/measurement-summary.json) и
|
||||
[команда агрегации](forward-final-2026-11-06/measurement-summary.txt).
|
||||
|
||||
## Reconciler и сохранённые доказательства
|
||||
|
||||
На новом стенде dry-run нашёл ровно внедрённые расхождения и не изменил 24 объекта / 27 строк.
|
||||
Apply исправил 3 старых orphan, 9 ready перевёл в карантин и удалил 6 старых pending
|
||||
с 6 audit-событиями; повтор дал 0 действий. Ссылки сообщений сохранены, свежие записи не удалены,
|
||||
снятие карантина возможно только после совпадения SHA-256, и без `--deep`.
|
||||
Одновременный запуск пропущен, SIGTERM завершил процесс за 0,1 с (exit 143, init=true),
|
||||
после него lock доступен. При остановленном S3 выход 1 за 2,32 с, без изменения состояния.
|
||||
|
||||
Нагрузка 75 с: 3364 upload с 201, 59 проходов сверки, ошибок и потерянных ready 0.
|
||||
Удалены только 5 внедрённых/состарившихся orphan и 5 pending; 55 возможных missing
|
||||
повторно проверены. Независимый deep-аудит всех готовых вложений проверил байты:
|
||||
[under-load.json](forward-final-2026-11-06/reconcile-demo/under-load.json),
|
||||
[check-under-load.json](forward-final-2026-11-06/reconcile-demo/check-under-load.json).
|
||||
|
||||
Стоимость 1k/10k/30k/100k повторно не снималась: алгоритм, SQL/S3-адаптеры вложений,
|
||||
CLI, shared, схема, зависимости, compose и драйвер cost побайтно не изменились от базы ЛР4.
|
||||
В сохранённой cost-серии API/LB/Valkey были остановлены, поздние изменения Identity/валидации/LB
|
||||
не входят в измеряемый путь. Проверка: [retained-cost-audit.txt](forward-final-2026-11-06/retained-cost-audit.txt).
|
||||
27 точек остаются результатами SHA `3402fd69d4922e500035a204d957be2cccaeb85a`,
|
||||
[исходное сырьё](sqlalchemy-2026-11-06/track5/measurements/cost/).
|
||||
Медианы 100k: shallow 20,215 с, deep 110,910 с (58,661–147,215 с).
|
||||
Страничность и ограниченная память подтверждены; линейность времени не подтвердилась,
|
||||
разброс deep и ограничения одного хоста сохраняются. Это не новые замеры на SHA 75b93bb.
|
||||
Прежняя полная матрица памяти (36 точек) также остаётся исторической; новые 3 точки её не заменяют.
|
||||
IAM/bootstrap не менялись; прежние 31 проверка private bucket, прав и повторного bootstrap
|
||||
сохраняют исходный SHA и находятся в `sqlalchemy-2026-11-06/grade3/`.
|
||||
|
||||
## Ограничения и завершение
|
||||
|
||||
Сохранён minor источника: `src/messenger/messaging/entrypoints/schemas.py:35`
|
||||
сериализует text до доменной проверки. Для непарного surrogate U+D800/U+DFFF
|
||||
получен `PydanticSerializationError`, реальный HTTP вернул 500 internal_error.
|
||||
[Локальная проверка](forward-final-2026-11-06/known-minor.txt),
|
||||
[HTTP-проверка](forward-final-2026-11-06/known-minor-http.txt).
|
||||
Это известный крайний случай некорректного Unicode, не успешно пройденный тест;
|
||||
по актуальному правилу minor сохранён в findings и ограничениях REPORT без исправления.
|
||||
[Машиночитаемый finding](forward-final-2026-11-06/findings.json).
|
||||
|
||||
При реализации проверены через Context7 `redis-py /redis/redis-py/v8.1.0`
|
||||
(`eval`, async close) и `SQLAlchemy /sqlalchemy/sqlalchemy/rel_2_0_45`
|
||||
(`with_for_update(read=True, key_share=True)` → `FOR KEY SHARE`).
|
||||
|
||||
Основной стенд и demo остановлены `make down`, fixture — `docker compose ... down`;
|
||||
volumes не удалялись. [main-down.txt](forward-final-2026-11-06/main-down.txt),
|
||||
[reconcile-down.txt](forward-final-2026-11-06/reconcile-down.txt),
|
||||
[shutdown-state.txt](forward-final-2026-11-06/shutdown-state.txt): у всех трёх project
|
||||
0 контейнеров, сохранено 6 постоянных volumes. Для проверки использованы `docker ps -aq
|
||||
--filter label=com.docker.compose.project=<project>` и `docker volume ls -q` с тем же фильтром.
|
||||
В логах только нормализованы конечные пробелы и завершающая пустая строка; числа/исходы сохранены.
|
||||
Шесть main specs синхронизированы с сохранением прежних сценариев, change закрыт в
|
||||
`openspec/changes/archive/2026-11-06-forward-lab3-final-review-fixes/` (`lab: 4`):
|
||||
[archive log](forward-final-2026-11-06/openspec-archive.txt). `--skip-specs` использован
|
||||
после ручной синхронизации и проверки полного совпадения дельт с main specs.
|
||||
Завершающие проверки: [final-checks.txt](forward-final-2026-11-06/final-checks.txt),
|
||||
[precommit-checks.txt](forward-final-2026-11-06/precommit-checks.txt).
|
||||
Изменения нормативных файлов, публикация, push и Telegram не выполнялись.
|
||||
@@ -0,0 +1,5 @@
|
||||
date: 2026-11-06T09:38:20Z commit: 95511002b12510178a3cc2a22566b43e2b2b6c81
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab6", "LB_HTTP_PORT": "18086", "LB_STATS_PORT": "26085", "BASE_URL": "http://127.0.0.1:18086", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ python3 scripts/obs_check.py query 'count by (__name__,job) ({job=~"messenger-.*"})' 'count by (http_route,http_request_method,http_response_status_code) (http_server_request_duration_seconds_count)' 'count by (job_type,outcome) (messenger_jobs_processed_total)'
|
||||
{"ts": "2026-11-06T09:38:20+00:00", "results": {"count by (__name__,job) ({job=~\"messenger-.*\"})": [{"labels": {"job": "messenger-worker"}, "value": "7"}, {"labels": {"job": "messenger-worker"}, "value": "7"}, {"labels": {"job": "messenger-worker"}, "value": "7"}, {"labels": {"job": "messenger-worker"}, "value": "77"}, {"labels": {"job": "messenger-worker"}, "value": "4"}, {"labels": {"job": "messenger-api"}, "value": "17"}, {"labels": {"job": "messenger-api"}, "value": "66"}, {"labels": {"job": "messenger-api"}, "value": "66"}, {"labels": {"job": "messenger-api"}, "value": "990"}, {"labels": {"job": "messenger-api"}, "value": "66"}, {"labels": {"job": "messenger-api"}, "value": "66"}, {"labels": {"job": "messenger-api"}, "value": "1056"}, {"labels": {"job": "messenger-api"}, "value": "34"}, {"labels": {"job": "messenger-api"}, "value": "34"}, {"labels": {"job": "messenger-api"}, "value": "544"}, {"labels": {"job": "messenger-api"}, "value": "8"}], "count by (http_route,http_request_method,http_response_status_code) (http_server_request_duration_seconds_count)": [{"labels": {"http_request_method": "POST", "http_response_status_code": "201", "http_route": "/api/v1/auth/sessions"}, "value": "5"}, {"labels": {"http_request_method": "POST", "http_response_status_code": "409", "http_route": "/api/v1/users"}, "value": "1"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "404", "http_route": "/api/v1/chats/{chat_id}"}, "value": "1"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "200", "http_route": "/api/v1/chats"}, "value": "2"}, {"labels": {"http_request_method": "POST", "http_response_status_code": "201", "http_route": "/api/v1/chats/{chat_id}/messages"}, "value": "5"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "200", "http_route": "/api/v1/chats/{chat_id}/messages"}, "value": "3"}, {"labels": {"http_request_method": "POST", "http_response_status_code": "400", "http_route": "/api/v1/chats/{chat_id}/messages"}, "value": "2"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "400", "http_route": "/api/v1/chats/{chat_id}/messages"}, "value": "1"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "401", "http_route": "/api/v1/users/me"}, "value": "2"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "200", "http_route": "/api/v1/users/me"}, "value": "4"}, {"labels": {"http_request_method": "POST", "http_response_status_code": "409", "http_route": "/api/v1/chats/{chat_id}/messages"}, "value": "2"}, {"labels": {"http_request_method": "POST", "http_response_status_code": "202", "http_route": "/api/v1/chats/{chat_id}/attachments"}, "value": "7"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "200", "http_route": "/api/v1/attachments/{attachment_id}"}, "value": "7"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "200", "http_route": "/api/v1/attachments/{attachment_id}/content"}, "value": "5"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "404", "http_route": "/api/v1/attachments/{attachment_id}/content"}, "value": "1"}, {"labels": {"http_request_method": "DELETE", "http_response_status_code": "204", "http_route": "/api/v1/auth/sessions/current"}, "value": "2"}, {"labels": {"http_request_method": "DELETE", "http_response_status_code": "401", "http_route": "/api/v1/auth/sessions/current"}, "value": "1"}, {"labels": {"http_request_method": "POST", "http_response_status_code": "201", "http_route": "/api/v1/users"}, "value": "5"}, {"labels": {"http_request_method": "POST", "http_response_status_code": "201", "http_route": "/api/v1/chats"}, "value": "4"}, {"labels": {"http_request_method": "POST", "http_response_status_code": "404", "http_route": "/api/v1/chats/{chat_id}/messages"}, "value": "1"}, {"labels": {"http_request_method": "POST", "http_response_status_code": "401", "http_route": "/api/v1/auth/sessions"}, "value": "1"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "404", "http_route": "/api/v1/attachments/{attachment_id}"}, "value": "1"}, {"labels": {"http_request_method": "GET", "http_response_status_code": "409", "http_route": "/api/v1/attachments/{attachment_id}/content"}, "value": "2"}, {"labels": {"http_request_method": "POST", "http_response_status_code": "415", "http_route": "/api/v1/chats/{chat_id}/attachments"}, "value": "1"}], "count by (job_type,outcome) (messenger_jobs_processed_total)": [{"labels": {"job_type": "attachment.process.v1", "outcome": "done"}, "value": "3"}, {"labels": {"job_type": "attachment.process.v1", "outcome": "duplicate_noop"}, "value": "1"}, {"labels": {"job_type": "attachment.process.v1", "outcome": "retry_scheduled"}, "value": "2"}, {"labels": {"job_type": "attachment.process.v1", "outcome": "failed"}, "value": "1"}]}}
|
||||
exit_code: 0 elapsed_seconds: 0.057
|
||||
@@ -0,0 +1,701 @@
|
||||
date: 2026-11-06T09:41:11Z commit: 2903d9dc73171d988ed0a1118b42ba8e13eaa088 project: hlpipe-lab6-clean-20261106094111
|
||||
HTTP=18086 stats=26085
|
||||
$ git clone --quiet --no-hardlinks /Users/artemkostylev/projects/learning/HL/labs/mtusi2026lab6 /Users/artemkostylev/projects/learning/HL/labs/mtusi2026lab6/.verification/hlpipe-lab6-clean-20261106094111
|
||||
$ git checkout --quiet --detach 2903d9dc73171d988ed0a1118b42ba8e13eaa088
|
||||
$ 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
|
||||
создан secrets/s3_reconciler_access_key_id
|
||||
создан secrets/s3_reconciler_secret_access_key
|
||||
создан .env из .env.example
|
||||
sh scripts/broker-secrets.sh
|
||||
broker and S3 worker secrets ready in secrets/ (values not printed)
|
||||
sh scripts/secrets-lab6.sh
|
||||
secrets/grafana_admin_password is ready (value not printed)
|
||||
$ docker compose --env-file .env config --quiet
|
||||
$ make up
|
||||
sh scripts/secrets.sh
|
||||
sh scripts/broker-secrets.sh
|
||||
broker and S3 worker secrets ready in secrets/ (values not printed)
|
||||
sh scripts/secrets-lab6.sh
|
||||
secrets/grafana_admin_password is ready (value not printed)
|
||||
docker compose build
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 545B done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 1.65kB done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [internal] load metadata for ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [internal] load metadata for docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#4 DONE 2.0s
|
||||
|
||||
#5 [internal] load .dockerignore
|
||||
#5 transferring context: 453B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [builder 1/7] FROM docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#6 resolve docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d 0.0s done
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 FROM ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#7 resolve ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 0.0s done
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [internal] load build context
|
||||
#8 transferring context: 605.69kB 0.0s done
|
||||
#8 DONE 0.0s
|
||||
|
||||
#9 [builder 3/7] WORKDIR /build
|
||||
#9 CACHED
|
||||
|
||||
#10 [builder 4/7] COPY pyproject.toml uv.lock README.md ./
|
||||
#10 CACHED
|
||||
|
||||
#11 [builder 2/7] COPY --from=ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /usr/local/bin/uv
|
||||
#11 CACHED
|
||||
|
||||
#12 [builder 5/7] RUN uv sync --locked --no-dev --no-install-project --no-editable
|
||||
#12 CACHED
|
||||
|
||||
#13 [builder 6/7] COPY src ./src
|
||||
#13 DONE 0.0s
|
||||
|
||||
#14 [builder 7/7] RUN uv sync --locked --no-dev --no-editable
|
||||
#14 0.140 Resolved 100 packages in 0.45ms
|
||||
#14 0.142 Building mtusi-messenger @ file:///build
|
||||
#14 2.014 Built mtusi-messenger @ file:///build
|
||||
#14 2.018 Prepared 1 package in 1.87s
|
||||
#14 2.022 Installed 1 package in 3ms
|
||||
#14 2.133 Bytecode compiled 2802 files in 110ms
|
||||
#14 2.133 + mtusi-messenger==1.6.0 (from file:///build)
|
||||
#14 DONE 2.2s
|
||||
|
||||
#15 [runtime 2/6] RUN groupadd --system --gid 10001 messenger && useradd --system --uid 10001 --gid messenger --no-create-home --shell /usr/sbin/nologin messenger
|
||||
#15 CACHED
|
||||
|
||||
#16 [runtime 3/6] COPY --from=builder --chown=root:root /opt/venv /opt/venv
|
||||
#16 DONE 0.5s
|
||||
|
||||
#17 [runtime 4/6] WORKDIR /app
|
||||
#17 DONE 0.0s
|
||||
|
||||
#18 [runtime 5/6] COPY --chown=root:root alembic.ini ./
|
||||
#18 DONE 0.0s
|
||||
|
||||
#19 [runtime 6/6] COPY --chown=root:root alembic ./alembic
|
||||
#19 DONE 0.0s
|
||||
|
||||
#20 exporting to image
|
||||
#20 exporting layers
|
||||
#20 exporting layers 3.0s done
|
||||
#20 exporting manifest sha256:e6eecc6e471ef54fae2e845bf4c7872567a514ba260b96e65bfc6ebb7868c7ff
|
||||
#20 exporting manifest sha256:e6eecc6e471ef54fae2e845bf4c7872567a514ba260b96e65bfc6ebb7868c7ff 0.0s done
|
||||
#20 exporting config sha256:809d4de7fd1083c389167c8b5964152777e67c008a3432ca9a7fb77adca5ae62 done
|
||||
#20 exporting attestation manifest sha256:480e3265c87cd9a0025891327b1a265819175c3eb71e6fe75caa02c5d386059e done
|
||||
#20 exporting manifest list sha256:ef4761263d3a88c52b6cfeaa5f75e15c3f0f2c12561c05d0e45ec083f4565606 done
|
||||
#20 naming to docker.io/library/mtusi-messenger:hlpipe-lab6-clean-20261106094111 done
|
||||
#20 unpacking to docker.io/library/mtusi-messenger:hlpipe-lab6-clean-20261106094111
|
||||
#20 unpacking to docker.io/library/mtusi-messenger:hlpipe-lab6-clean-20261106094111 0.7s done
|
||||
#20 DONE 3.8s
|
||||
|
||||
#21 resolving provenance for metadata file
|
||||
#21 DONE 0.0s
|
||||
api Built
|
||||
docker compose up -d --wait
|
||||
Network hlpipe-lab6-clean-20261106094111_backend Creating
|
||||
Network hlpipe-lab6-clean-20261106094111_backend Created
|
||||
Network hlpipe-lab6-clean-20261106094111_edge Creating
|
||||
Network hlpipe-lab6-clean-20261106094111_edge Created
|
||||
Volume "hlpipe-lab6-clean-20261106094111_healthtools" Creating
|
||||
Volume "hlpipe-lab6-clean-20261106094111_healthtools" Created
|
||||
Volume "hlpipe-lab6-clean-20261106094111_broker-data" Creating
|
||||
Volume "hlpipe-lab6-clean-20261106094111_broker-data" Created
|
||||
Volume "hlpipe-lab6-clean-20261106094111_valkeydata" Creating
|
||||
Volume "hlpipe-lab6-clean-20261106094111_valkeydata" Created
|
||||
Volume "hlpipe-lab6-clean-20261106094111_grafana-data" Creating
|
||||
Volume "hlpipe-lab6-clean-20261106094111_grafana-data" Created
|
||||
Volume "hlpipe-lab6-clean-20261106094111_prometheus-data" Creating
|
||||
Volume "hlpipe-lab6-clean-20261106094111_prometheus-data" Created
|
||||
Volume "hlpipe-lab6-clean-20261106094111_pgdata" Creating
|
||||
Volume "hlpipe-lab6-clean-20261106094111_pgdata" Created
|
||||
Volume "hlpipe-lab6-clean-20261106094111_s3data" Creating
|
||||
Volume "hlpipe-lab6-clean-20261106094111_s3data" Created
|
||||
Volume "hlpipe-lab6-clean-20261106094111_tempo-data" Creating
|
||||
Volume "hlpipe-lab6-clean-20261106094111_tempo-data" Created
|
||||
Volume "hlpipe-lab6-clean-20261106094111_loki-data" Creating
|
||||
Volume "hlpipe-lab6-clean-20261106094111_loki-data" Created
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-lb-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-prometheus-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-valkey-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-valkey-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-loki-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-tempo-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-otel-collector-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-prometheus-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-lb-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-otel-collector-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-tempo-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-worker-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-relay-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-loki-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-grafana-1 Creating
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-grafana-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-relay-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-worker-1 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Created
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-valkey-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-lb-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-prometheus-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-valkey-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-prometheus-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-lb-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-tempo-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-otel-collector-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-loki-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-loki-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-otel-collector-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-tempo-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-grafana-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-grafana-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-relay-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-worker-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-worker-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-relay-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-prometheus-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-worker-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-relay-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-tempo-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-otel-collector-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-loki-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-grafana-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-valkey-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-lb-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-prometheus-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-grafana-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-valkey-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Exited
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-otel-collector-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-worker-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-relay-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-lb-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-loki-1 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-tempo-1 Healthy
|
||||
scripts/lb-wait.sh
|
||||
$ docker compose ps -a --format {{.Service}} {{.State}} {{.Status}} {{.Ports}}
|
||||
api running Up 13 seconds (healthy)
|
||||
api running Up 13 seconds (healthy)
|
||||
broker running Up 20 seconds (healthy) 127.0.0.1:26086->15672/tcp
|
||||
grafana running Up 19 seconds (healthy) 127.0.0.1:26300->3000/tcp
|
||||
healthtools exited Exited (0) 20 seconds ago
|
||||
lb running Up 20 seconds (healthy) 127.0.0.1:18086->8080/tcp, 127.0.0.1:26085->8404/tcp
|
||||
loki running Up 19 seconds (healthy) 127.0.0.1:26310->3100/tcp
|
||||
migrate exited Exited (0) 17 seconds ago
|
||||
otel-collector running Up 19 seconds (healthy) 4317-4318/tcp, 55679/tcp
|
||||
postgres running Up 20 seconds (healthy)
|
||||
prometheus running Up 20 seconds (healthy) 127.0.0.1:26090->9090/tcp
|
||||
relay running Up 13 seconds (healthy)
|
||||
s3 running Up 20 seconds (healthy)
|
||||
s3-init exited Exited (0) 14 seconds ago
|
||||
tempo running Up 19 seconds (healthy) 127.0.0.1:26320->3200/tcp
|
||||
valkey running Up 20 seconds (healthy)
|
||||
worker running Up 13 seconds (healthy)
|
||||
$ make test
|
||||
python3 tests/smoke.py --base-url "http://127.0.0.1:18086"
|
||||
PASS: lab6 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:18086"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
$ 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:18086"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 133, "failed_attempts": 0, "first_recovery_seconds": 3.19}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
$ docker compose ps -a --format {{.Service}} {{.Name}} {{.State}} api
|
||||
api hlpipe-lab6-clean-20261106094111-api-1 running
|
||||
api hlpipe-lab6-clean-20261106094111-api-2 exited
|
||||
$ make restore
|
||||
scripts/restore.sh
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Running
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Starting
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Started
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Healthy
|
||||
$ make scenario SCENARIO=failover-upload
|
||||
python3 scripts/lab4_scenarios.py failover-upload --base-url "http://127.0.0.1:18086" --restore --output evidence/failover-upload.json
|
||||
{
|
||||
"ok": true,
|
||||
"date": "2026-11-06T09:43:15Z",
|
||||
"commit": "2903d9dc73171d988ed0a1118b42ba8e13eaa088",
|
||||
"scenario": "failover-upload",
|
||||
"upload_instance": "405a5a34e1f0",
|
||||
"download_instance": "175536090b12",
|
||||
"sha256_equal": true,
|
||||
"hook_seconds": 2.793,
|
||||
"download_ok_after_seconds": 2.857,
|
||||
"replicas_at_download": [
|
||||
{
|
||||
"hostname": "175536090b12",
|
||||
"status": "running",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:42:51.597999469Z",
|
||||
"finished_at": "2026-11-06T09:42:45.065840757Z"
|
||||
},
|
||||
{
|
||||
"hostname": "405a5a34e1f0",
|
||||
"status": "exited",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:43:12.015906006Z",
|
||||
"finished_at": "2026-11-06T09:43:19.750579801Z"
|
||||
}
|
||||
],
|
||||
"restored": true,
|
||||
"replicas_after_restore": [
|
||||
{
|
||||
"hostname": "175536090b12",
|
||||
"status": "running",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:42:51.597999469Z",
|
||||
"finished_at": "2026-11-06T09:42:45.065840757Z"
|
||||
},
|
||||
{
|
||||
"hostname": "405a5a34e1f0",
|
||||
"status": "running",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:43:20.21862376Z",
|
||||
"finished_at": "2026-11-06T09:43:19.750579801Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
scripts/lb-wait.sh
|
||||
$ make restore
|
||||
scripts/restore.sh
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Running
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Running
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Waiting
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Healthy
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Healthy
|
||||
$ make scenario SCENARIO=s3-outage
|
||||
python3 scripts/lab4_scenarios.py s3-outage --base-url "http://127.0.0.1:18086" --restore --output evidence/s3-outage.json
|
||||
{
|
||||
"ok": true,
|
||||
"date": "2026-11-06T09:43:24Z",
|
||||
"commit": "2903d9dc73171d988ed0a1118b42ba8e13eaa088",
|
||||
"scenario": "s3-outage",
|
||||
"s3_container_during_outage": [
|
||||
{
|
||||
"hostname": "00bac2bc8917",
|
||||
"status": "exited",
|
||||
"exit_code": "0",
|
||||
"started_at": "2026-11-06T09:42:45.426583091Z",
|
||||
"finished_at": "2026-11-06T09:43:25.572619096Z"
|
||||
}
|
||||
],
|
||||
"during_outage": {
|
||||
"upload": {
|
||||
"status": 503,
|
||||
"seconds": 4.43,
|
||||
"instance": "175536090b12"
|
||||
},
|
||||
"metadata": {
|
||||
"status": 200,
|
||||
"seconds": 0.013,
|
||||
"instance": "405a5a34e1f0"
|
||||
},
|
||||
"download": {
|
||||
"status": 503,
|
||||
"seconds": 2.333,
|
||||
"instance": "175536090b12"
|
||||
},
|
||||
"text_message": {
|
||||
"status": 201,
|
||||
"seconds": 0.029,
|
||||
"instance": "405a5a34e1f0"
|
||||
},
|
||||
"health_ready": {
|
||||
"status": 200,
|
||||
"seconds": 0.003,
|
||||
"instance": "175536090b12"
|
||||
}
|
||||
},
|
||||
"expected": {
|
||||
"upload": 503,
|
||||
"download": 503,
|
||||
"text_message": 201
|
||||
},
|
||||
"as_expected": true,
|
||||
"s3_back_healthy_seconds": 5.772,
|
||||
"download_after_recovery": "sha256 equal"
|
||||
}
|
||||
scripts/lb-wait.sh
|
||||
$ sh scripts/s3-check.sh
|
||||
date: 2026-11-06T09:43:38Z commit: 2903d9dc73171d988ed0a1118b42ba8e13eaa088 == S3 privacy and bootstrap checks
|
||||
PASS s3: опубликованные host-порты: нет
|
||||
PASS s3: консоль :9001 внутри контейнера: 000
|
||||
PASS s3-init: повторный запуск 1: 0
|
||||
PASS s3-init: повторный запуск 2: 0
|
||||
PASS s3-init: состояние IAM/bucket не изменилось: same
|
||||
PASS api: PutObject: allow
|
||||
PASS api: HeadObject: allow
|
||||
PASS api: GetObject: allow
|
||||
PASS api: ListBucket: deny
|
||||
PASS reconciler: ListBucket: allow
|
||||
PASS reconciler: HeadObject: allow
|
||||
PASS reconciler: GetObject: allow
|
||||
PASS reconciler: PutObject: deny
|
||||
PASS reconciler: DeleteObject: allow
|
||||
PASS reconciler: CreateBucket: deny
|
||||
PASS reconciler: PutBucketPolicy (public): deny
|
||||
PASS reconciler: admin ListUsers: deny
|
||||
PASS api: CreateBucket: deny
|
||||
PASS api: DeleteBucket: deny
|
||||
PASS api: PutBucketPolicy (public): deny
|
||||
PASS api: PutBucketLifecycle (HeadBucket уже 403): deny
|
||||
PASS api: admin ListUsers: deny
|
||||
PASS api: PutObject в чужой bucket: deny
|
||||
PASS api: ListBucket чужого bucket: deny
|
||||
PASS anonymous: HeadObject: deny
|
||||
PASS anonymous: ListBucket: deny
|
||||
PASS anonymous: PutObject: deny
|
||||
PASS anonymous: прямой HTTP GET объекта из отдельного контейнера: 403
|
||||
PASS bucket: anonymous policy: private
|
||||
PASS api: DeleteObject: allow
|
||||
PASS s3: консоль :9001 из отдельного контейнера сети стенда: connection refused
|
||||
== IAM/bucket snapshot (без секретов)
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"key": "messenger-attachments",
|
||||
"last_modified": "2026-11-06T09:42:23Z",
|
||||
"is_dir": true
|
||||
}
|
||||
],
|
||||
"truncated": false
|
||||
}
|
||||
{
|
||||
"path": "root/messenger-attachments",
|
||||
"permission": "private"
|
||||
}
|
||||
{
|
||||
"name": "messenger-api",
|
||||
"policy": {
|
||||
"policy": {
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"s3:GetObject",
|
||||
"s3:PutObject",
|
||||
"s3:DeleteObject"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:s3:::messenger-attachments/*"
|
||||
],
|
||||
"Sid": "MessengerApiObjects"
|
||||
}
|
||||
],
|
||||
"Version": "2012-10-17"
|
||||
},
|
||||
"policy_name": "messenger-api"
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "messenger-reconciler",
|
||||
"policy": {
|
||||
"policy": {
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"s3:GetObject",
|
||||
"s3:DeleteObject"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:s3:::messenger-attachments/*"
|
||||
],
|
||||
"Sid": "MessengerReconcilerObjects"
|
||||
},
|
||||
{
|
||||
"Action": [
|
||||
"s3:ListBucket"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:s3:::messenger-attachments"
|
||||
],
|
||||
"Sid": "MessengerReconcilerListing"
|
||||
}
|
||||
],
|
||||
"Version": "2012-10-17"
|
||||
},
|
||||
"policy_name": "messenger-reconciler"
|
||||
}
|
||||
}
|
||||
{
|
||||
"accessKey": "<api-key>",
|
||||
"status": "enabled",
|
||||
"policies": [
|
||||
"messenger-api"
|
||||
],
|
||||
"memberOf": []
|
||||
}
|
||||
{
|
||||
"accessKey": "<reconciler-key>",
|
||||
"status": "enabled",
|
||||
"policies": [
|
||||
"messenger-reconciler"
|
||||
],
|
||||
"memberOf": []
|
||||
}
|
||||
{
|
||||
"rules": [
|
||||
{
|
||||
"id": "abort-incomplete-uploads",
|
||||
"status": "Enabled",
|
||||
"prefix": "",
|
||||
"abortIncompleteMultipartUploadDays": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
RESULT: PASS
|
||||
$ make reconcile
|
||||
docker compose run --rm --no-deps reconciler
|
||||
{
|
||||
"mode": "dry-run",
|
||||
"skipped": false,
|
||||
"grace_seconds": 3600,
|
||||
"skew_seconds": 60,
|
||||
"deep": false,
|
||||
"page_size": 1000,
|
||||
"scanned": {
|
||||
"objects": 0,
|
||||
"rows": 0
|
||||
},
|
||||
"found": {
|
||||
"orphan_stale": 0,
|
||||
"orphan_fresh": 0,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"pending_fresh": 0,
|
||||
"quarantined": 0,
|
||||
"healed": 0
|
||||
},
|
||||
"fixed": {
|
||||
"orphan_stale": 0,
|
||||
"missing": 0,
|
||||
"size_mismatch": 0,
|
||||
"sha_mismatch": 0,
|
||||
"pending_stale": 0,
|
||||
"healed": 0
|
||||
},
|
||||
"rechecked": {},
|
||||
"errors": 0,
|
||||
"samples": {},
|
||||
"cost": {
|
||||
"seconds": 0.022,
|
||||
"requests": {
|
||||
"s3_list": 1,
|
||||
"s3_head": 0,
|
||||
"s3_get": 0,
|
||||
"s3_delete": 0,
|
||||
"sql": 1
|
||||
},
|
||||
"waited_seconds": {
|
||||
"s3_list": 0.009,
|
||||
"sql": 0.005
|
||||
},
|
||||
"hashed_bytes": 0,
|
||||
"cpu_seconds": 0.655,
|
||||
"max_rss_mib": 120.9
|
||||
}
|
||||
}
|
||||
$ make migrate
|
||||
docker compose run --rm migrate
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Running
|
||||
$ make down
|
||||
docker compose --profile bench --profile tools --profile reconcile down
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-otel-collector-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-worker-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-relay-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-grafana-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-lb-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-grafana-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-grafana-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-lb-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-lb-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-grafana-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-loki-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-tempo-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-prometheus-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-otel-collector-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-otel-collector-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-lb-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-otel-collector-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-prometheus-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-prometheus-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-prometheus-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-tempo-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-tempo-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-tempo-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-loki-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-loki-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-loki-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-healthtools-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-relay-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-relay-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-relay-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-worker-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-worker-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-worker-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-broker-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-api-2 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-api-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-valkey-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-init-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-migrate-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Stopping
|
||||
Container hlpipe-lab6-clean-20261106094111-valkey-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-valkey-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-valkey-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Stopped
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Removing
|
||||
Container hlpipe-lab6-clean-20261106094111-s3-1 Removed
|
||||
Container hlpipe-lab6-clean-20261106094111-postgres-1 Removed
|
||||
Network hlpipe-lab6-clean-20261106094111_backend Removing
|
||||
Network hlpipe-lab6-clean-20261106094111_edge Removing
|
||||
Network hlpipe-lab6-clean-20261106094111_backend Removed
|
||||
Network hlpipe-lab6-clean-20261106094111_edge Removed
|
||||
$ docker volume ls --filter label=com.docker.compose.project=hlpipe-lab6-clean-20261106094111
|
||||
DRIVER VOLUME NAME
|
||||
local hlpipe-lab6-clean-20261106094111_broker-data
|
||||
local hlpipe-lab6-clean-20261106094111_grafana-data
|
||||
local hlpipe-lab6-clean-20261106094111_healthtools
|
||||
local hlpipe-lab6-clean-20261106094111_loki-data
|
||||
local hlpipe-lab6-clean-20261106094111_pgdata
|
||||
local hlpipe-lab6-clean-20261106094111_prometheus-data
|
||||
local hlpipe-lab6-clean-20261106094111_s3data
|
||||
local hlpipe-lab6-clean-20261106094111_tempo-data
|
||||
local hlpipe-lab6-clean-20261106094111_valkeydata
|
||||
DRIVER VOLUME NAME
|
||||
local hlpipe-lab6-clean-20261106094111_broker-data
|
||||
local hlpipe-lab6-clean-20261106094111_grafana-data
|
||||
local hlpipe-lab6-clean-20261106094111_healthtools
|
||||
local hlpipe-lab6-clean-20261106094111_loki-data
|
||||
local hlpipe-lab6-clean-20261106094111_pgdata
|
||||
local hlpipe-lab6-clean-20261106094111_prometheus-data
|
||||
local hlpipe-lab6-clean-20261106094111_s3data
|
||||
local hlpipe-lab6-clean-20261106094111_tempo-data
|
||||
local hlpipe-lab6-clean-20261106094111_valkeydata
|
||||
exit_code: 0; volumes retained
|
||||
@@ -0,0 +1,153 @@
|
||||
date: 2026-11-06T09:38:20Z commit: 95511002b12510178a3cc2a22566b43e2b2b6c81
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab6", "LB_HTTP_PORT": "18086", "LB_STATS_PORT": "26085", "BASE_URL": "http://127.0.0.1:18086", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ python3 scripts/obs_check.py dashboards --strict
|
||||
{
|
||||
"checked_at": "2026-11-06T09:38:20+00:00",
|
||||
"targets": [
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "RPS бизнес-запросов",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "Доля 5xx (2m)",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "p95 latency (5m)",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "Доля не-5xx (окно 1h)",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "RPS по маршруту и классу статуса",
|
||||
"datasource": "prometheus",
|
||||
"series": 9,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "Доля ошибок",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "Доля ошибок",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "Latency p50 / p95 / p99",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "Latency p50 / p95 / p99",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "Latency p50 / p95 / p99",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "p95 по маршруту",
|
||||
"datasource": "prometheus",
|
||||
"series": 7,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "RPS по реплике",
|
||||
"datasource": "prometheus",
|
||||
"series": 4,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "Активные запросы",
|
||||
"datasource": "prometheus",
|
||||
"series": 8,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "Логи API (ошибки и предупреждения)",
|
||||
"datasource": "loki",
|
||||
"lines": 5
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-api.json",
|
||||
"panel": "Трассы API с ошибкой",
|
||||
"datasource": "tempo",
|
||||
"traces": 0
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-pipeline.json",
|
||||
"panel": "Jobs по исходу",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-pipeline.json",
|
||||
"panel": "Длительность обработки job",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-pipeline.json",
|
||||
"panel": "Длительность обработки job",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-pipeline.json",
|
||||
"panel": "Длительность обработки job",
|
||||
"datasource": "prometheus",
|
||||
"series": 1,
|
||||
"missing_metrics": []
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-pipeline.json",
|
||||
"panel": "Логи worker",
|
||||
"datasource": "loki",
|
||||
"lines": 5
|
||||
},
|
||||
{
|
||||
"dashboard": "messenger-pipeline.json",
|
||||
"panel": "Трассы worker",
|
||||
"datasource": "tempo",
|
||||
"traces": 5
|
||||
}
|
||||
],
|
||||
"problems": []
|
||||
}
|
||||
exit_code: 0 elapsed_seconds: 0.089
|
||||
@@ -0,0 +1,43 @@
|
||||
date: 2026-11-06T09:34:33Z commit: 95511002b12510178a3cc2a22566b43e2b2b6c81
|
||||
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab6", "LB_HTTP_PORT": "18086", "LB_STATS_PORT": "26085", "BASE_URL": "http://127.0.0.1:18086", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
||||
$ env EVIDENCE_DIR=evidence/grade3/failover-first make failover-evidence SHIFT=0
|
||||
sh scripts/failover-evidence.sh "http://127.0.0.1:18086" "0"
|
||||
date: 2026-11-06T09:34:33Z commit: 95511002b12510178a3cc2a22566b43e2b2b6c81
|
||||
== before: api replicas (hostname = X-Instance-Id), state, StartedAt, FinishedAt
|
||||
9af2280c8af3 running started=2026-11-06T09:33:56.602420846Z finished=2026-11-06T09:33:50.075450885Z
|
||||
943813ecb712 running started=2026-11-06T09:33:56.539288471Z finished=2026-11-06T09:33:50.07508976Z
|
||||
$ 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:18086"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 134, "failed_attempts": 0, "first_recovery_seconds": 3.03}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
== after: api replicas
|
||||
9af2280c8af3 exited started=2026-11-06T09:33:56.602420846Z finished=2026-11-06T09:34:38.360642671Z
|
||||
943813ecb712 running started=2026-11-06T09:33:56.539288471Z finished=2026-11-06T09:33:50.07508976Z
|
||||
== stopped replica: 9af2280c8af3; shutdown: signal, drain window with readiness 503, close, exit
|
||||
{"event":"Handling signal: term","level":"info","ts":"2026-11-06T09:34:35.851311Z"}
|
||||
{"limit":2.0,"event":"service.draining","level":"info","ts":"2026-11-06T09:34:35.864420Z"}
|
||||
{"limit":2.0,"event":"service.draining","level":"info","ts":"2026-11-06T09:34:35.897236Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"5818535d613b4b7a8f0607d91e58d3f5","duration_ms":0.837,"event":"request.handled","level":"info","ts":"2026-11-06T09:34:36.062326Z"}
|
||||
{"method":"GET","route":"/health/ready","status":503,"request_id":"4838cbd4822f4181a2e10153a41033d6","duration_ms":0.347,"event":"request.handled","level":"info","ts":"2026-11-06T09:34:36.566176Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-11-06T09:34:37.866622Z"}
|
||||
{"event":"Shutting down","level":"info","ts":"2026-11-06T09:34:37.900282Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-11-06T09:34:37.973761Z"}
|
||||
{"event":"Finished server process [26]","level":"info","ts":"2026-11-06T09:34:37.977541Z"}
|
||||
{"event":"Worker (pid:26) was sent SIGTERM!","level":"info","ts":"2026-11-06T09:34:37.987715Z"}
|
||||
{"event":"service.stopped","level":"info","ts":"2026-11-06T09:34:38.004692Z"}
|
||||
{"event":"Finished server process [21]","level":"info","ts":"2026-11-06T09:34:38.006586Z"}
|
||||
{"event":"Worker (pid:21) was sent SIGTERM!","level":"info","ts":"2026-11-06T09:34:38.093383Z"}
|
||||
{"event":"Shutting down: Master","level":"info","ts":"2026-11-06T09:34:38.195744Z"}
|
||||
$ scripts/restore.sh
|
||||
Container mtusi2026lab6-api-2 Running
|
||||
Container mtusi2026lab6-api-1 Starting
|
||||
Container mtusi2026lab6-api-1 Started
|
||||
Container mtusi2026lab6-api-2 Waiting
|
||||
Container mtusi2026lab6-api-1 Waiting
|
||||
Container mtusi2026lab6-api-2 Healthy
|
||||
Container mtusi2026lab6-api-1 Healthy
|
||||
== after restore
|
||||
9af2280c8af3 running started=2026-11-06T09:34:51.34604076Z finished=2026-11-06T09:34:38.360642671Z
|
||||
943813ecb712 running started=2026-11-06T09:33:56.539288471Z finished=2026-11-06T09:33:50.07508976Z
|
||||
exit_code: 0 elapsed_seconds: 20.584
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user