docs: record pipeline-reliability evidence and report

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 16:51:29 +03:00
co-authored by Claude Opus 5.5
parent e2a6427c24
commit 6bd60532aa
38 changed files with 2802 additions and 484 deletions
+26 -21
View File
@@ -1,23 +1,25 @@
# Согласованность БД и S3 на рабочем стенде
- Команда: `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 upload-consistency`
- Дата: 2026-10-31, 03:51 UTC; код выхода 0
- Commit: `ff1a83b`, рабочее дерево чистое
- Дата: 2026-10-31, 13:26:56–13:27:41 UTC; код выхода 0
- Commit: `e2a6427` (ветка `feat/pipeline-reliability`), рабочее дерево без правок кода (добавлены только файлы `evidence/`)
- Стенд: проект compose `mtusi-lab5`, собран `make run_docker` из `HEAD`
- Что показано: загрузка при замороженном S3 и со сбоем фиксации `queued` — 503; строки `pending` не видны (404); компенсация удалила объект staging; `cleaner --once` с grace 30 с убрал обе строки и объекты по ключу staging; объектов без строки нет; готовое вложение R цело
- Что показано: загрузка при замороженном S3 и со сбоем фиксации `queued` — 503; строки `pending` не видны (404); компенсация удалила объект staging; `cleaner --once` с grace 30 с убрал обе строки и объекты по ключу staging; тот же проход убрал staging готового R (с уровня 4: `removed_ready`, `staging_key` пуст); объектов без строки нет; R цело
- Вывод сокращён: записи уборщика — только основные поля
```text
upload with paused S3: 503 after 5.1 s
pending e2cb151f-c974-41e5-b34a-519674f94fd5: pending age 5 s key messenger/attachments/e2cb151f-c974-41e5-b34a-519674f94fd5/original
pending b09647d4-29c0-4701-8855-56a1f54c870f: pending age 0 s key messenger/attachments/b09647d4-29c0-4701-8855-56a1f54c870f/original
pending af17a40f-983c-4625-a2c0-a8488750a7cb: pending age 5 s key messenger/attachments/af17a40f-983c-4625-a2c0-a8488750a7cb/original
pending bf78eca6-fcb5-4498-9306-3702cce10ab6: pending age 0 s key messenger/attachments/bf78eca6-fcb5-4498-9306-3702cce10ab6/original
waiting 30 s for grace 30 s
cleaner --once (grace 30 s): exit 0
{"event": "Started cleaner", "instance_id": "9da70523aa0e", "module": "cleaner", "mode": "once", "interval_seconds": 60.0, "pending_grace_seconds": 30, "batch_size": 100, "live_upload_bound_seconds": 17.0, "once": true, "reconcile_interval_seconds": 3600.0, "reconcile_page_size": 1000, "reconcile_max_changes": 100, "reconcile_max_objects_per_second": 2000.0, "reconcile_apply": null, "reconcile_strategy": null, "reconcile_deep": null, "database_host": "postgres", "database_port": 5432, "database_name": "messenger", "database_pool_size": 1, "s3_host": "s3", "s3_port": 8333, "s3_bucket": "messenger", "level": "info", "timestamp": "2026-10-31T03:51:55.193513Z", "lineno": 229, "filename": "main.py", "func_name": "run"}
{"event": "Removed stale attachment", "instance_id": "9da70523aa0e", "module": "attachment_cleanup_service", "method": "clean_stale_pending", "attachment_id": "e2cb151f-c974-41e5-b34a-519674f94fd5", "object_key": "messenger/staging/e2cb151f-c974-41e5-b34a-519674f94fd5/original", "age_seconds": 42, "level": "info", "timestamp": "2026-10-31T03:51:55.381637Z", "lineno": 204, "filename": "attachment_cleanup.py", "func_name": "remove_stale_pending"}
{"event": "Removed stale attachment", "instance_id": "9da70523aa0e", "module": "attachment_cleanup_service", "method": "clean_stale_pending", "attachment_id": "b09647d4-29c0-4701-8855-56a1f54c870f", "object_key": "messenger/staging/b09647d4-29c0-4701-8855-56a1f54c870f/original", "age_seconds": 36, "level": "info", "timestamp": "2026-10-31T03:51:55.387529Z", "lineno": 204, "filename": "attachment_cleanup.py", "func_name": "remove_stale_pending"}
{"event": "Finished cleanup pass", "instance_id": "9da70523aa0e", "module": "attachment_cleanup_service", "method": "clean_stale_pending", "removed": 2, "skipped": 0, "interrupted_by": null, "duration_ms": 194, "level": "info", "timestamp": "2026-10-31T03:51:55.387656Z", "lineno": 127, "filename": "attachment_cleanup.py", "func_name": "clean_stale_pending"}
{"event": "Stopped cleaner", "instance_id": "9da70523aa0e", "module": "cleaner", "exit_code": 0, "level": "info", "timestamp": "2026-10-31T03:51:55.390025Z", "lineno": 273, "filename": "main.py", "func_name": "run"}
bucket messenger, prefix messenger/: 1159 objects, 1161 rows, 0 objects without a row
Started cleaner: mode once, interval_seconds 60.0, pending_grace_seconds 30, batch_size 100, staging_retention_seconds 86400, live_upload_bound_seconds 17.0
Removed stale attachment: af17a40f-983c-4625-a2c0-a8488750a7cb
Removed stale attachment: bf78eca6-fcb5-4498-9306-3702cce10ab6
Finished cleanup pass: removed 2, skipped 0, interrupted_by null, duration_ms 221
Finished staging cleanup pass: removed_ready 2, removed_failed 0, skipped 0, interrupted_by null, duration_ms 84
Stopped cleaner: exit_code 0
bucket messenger, prefix messenger/: 2428 objects, 2432 rows, 0 objects without a row
attachment R uploaded expected 202 got 202
attachment R processed expected ready got ready
upload with paused S3 expected 503 got 503
@@ -27,18 +29,21 @@ new pending rows (queued failure) expected 1 got 1
staging object after compensation expected absent got absent
staging object of the paused upload expected absent got absent
driver trigger left expected 0 got 0
metadata of pending e2cb151f expected 404 got 404
content of pending e2cb151f expected 404 got 404
message with e2cb151f expected 404 got 404
metadata of pending b09647d4 expected 404 got 404
content of pending b09647d4 expected 404 got 404
message with b09647d4 expected 404 got 404
metadata of pending af17a40f expected 404 got 404
content of pending af17a40f expected 404 got 404
message with af17a40f expected 404 got 404
metadata of pending bf78eca6 expected 404 got 404
content of pending bf78eca6 expected 404 got 404
message with bf78eca6 expected 404 got 404
cleaner --once exit code expected 0 got 0
row of e2cb151f expected absent got absent
object of e2cb151f expected absent got absent
row of b09647d4 expected absent got absent
object of b09647d4 expected absent got absent
R staging_key after the pass expected NULL got NULL
R metadata unchanged expected yes got yes
row of af17a40f expected absent got absent
object of af17a40f expected absent got absent
row of bf78eca6 expected absent got absent
object of bf78eca6 expected absent got absent
objects without a row expected 0 got 0
R staging object after the pass expected absent got absent
R downloaded expected 200 got 200
R sha256 = uploaded expected yes got yes
PASS: pending rows are invisible, the queued failure is compensated, the cleaner removed both uploads, no object without a row, R intact
+136
View File
@@ -0,0 +1,136 @@
# Шаг 4 сценария защиты: окна отказа
- Команда: `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 defense-faults`
- Дата: 2026-10-31, 13:20:45–13:22:52 UTC; итог `PASS`
- Commit: `e2a6427` (ветка `feat/pipeline-reliability`), рабочее дерево без правок кода (добавлены только файлы `evidence/`)
- Стенд: проект compose `mtusi-lab5`, собран `make run_docker` из `HEAD`: HAProxy, две реплики API, relay, worker, cleaner, PostgreSQL, Valkey, S3, RabbitMQ
- Спек: `student-tests`, «Шаг 4 на рабочем стенде»; решения 1, 3, 5, 14, 17 design change `pipeline-reliability`. Тем же порядком на стенде отказов — `test_defense_faults` (`evidence/tests/failure-checks.md`)
- Точек сбоя в коде нет: окна держат триггеры `driver_df_*` только на уникальный `filename` прогона, `docker kill` снаружи. Токенов и секретов в выводе нет, пользователи и чат синтетические
- Вывод сокращён: внутри окна строки скачивания вариантов свёрнуты в одну (каждый вариант проверен: 200, тип, размеры по байтам, SHA-256 = метаданным), итоговая таблица «проверка → ожидаемо → получено» без расхождений заменена её итогом
```text
window: after writing objects, before COMMIT
upload: 202
attachment id 9dbedb7b-9884-4122-bbc8-3ee3b3adb278
COMMIT of ready waits in the trigger: yes
action: docker kill worker
job state after kill: processing
attempt after kill: 1
job id 89767628-2179-40d8-9d08-5a882db756e4
thumbnail sha256 before the crash b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546
crop sha256 before the crash fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f
optimized sha256 before the crash 1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb
action: start worker, lease expires in 69 s
attachment status: ready
ready 70 s after the kill
next attempt not before the lease expired: yes
variants in metadata: crop,optimized,thumbnail
downloads: thumbnail image/jpeg (256, 160); crop image/jpeg (128, 128); optimized image/webp (320, 200)
thumbnail same sha256 in S3 and metadata: b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546
crop same sha256 in S3 and metadata: fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f
optimized same sha256 in S3 and metadata: 1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb
attempt: 2
job state: succeeded
queue empty: 0
window: after COMMIT, before ack
upload: 202
attachment id 5acffd71-f175-4c78-a2ed-58f90a2c27ad
COMMIT waits in the deferred trigger: yes
action: docker kill -s STOP worker
job state while frozen: succeeded
job id 23c4e081-66af-43a8-b9df-3b42508ea890
action: docker kill worker
message returned to the queue (no ack): 1
action: start worker
redelivered: 'Skipped job message', finished: yes
new attempts: 0
queue empty: 0
same updated_at: 2026-10-31T13:22:01.910196+00:00
attempt: 1
metadata unchanged: yes
downloads: thumbnail image/jpeg (256, 160); crop image/jpeg (128, 128); optimized image/webp (320, 200)
window: after COMMIT queued, before publish
action: docker kill relay
relay stays down: no
upload: 202
attachment id 092f2122-d3de-4034-a8d9-071c070a0f4b
job id 40467883-90e0-4e8a-905a-45ffe36cf2b6
job state: queued
published_at: None
messages in the queue: 0
action: start relay
attachment status: ready
downloads: thumbnail image/jpeg (256, 160); crop image/jpeg (128, 128); optimized image/webp (320, 200)
attempt: 1
window: after broker confirm, before the mark
action: docker compose stop worker
upload: 202
attachment id ea2e1492-1e1f-4dc3-b2fb-70a87c3c0986
the mark waits in the trigger: yes
action: docker kill relay
message in the queue: 1
job id f81f91fa-6d41-470d-9b27-a4086dc263f2
published_at: None
action: start relay
two messages with the worker stopped: 2
action: start worker
attachment status: ready
downloads: thumbnail image/jpeg (256, 160); crop image/jpeg (128, 128); optimized image/webp (320, 200)
queue empty: 0
attempt: 1
window: replay of a failed job
action: docker compose stop worker
upload: 202
attachment id f3b0e3cb-fec6-4604-a43f-32a35468ea3a
action: staging object replaced with other bytes of the same size
action: start worker
attachment status: failed
error_code: processing_failed
job id 13665040-1e95-4ad3-b1fc-759bb69322d0
reason: source_corrupted
action: replay --error-code processing_failed (registry, dry-run)
registry: exit 0
registry names the job: yes
registry changes nothing: state failed, attempt 1, attempt_base 0, last_error_code source_corrupted
action: original bytes returned to staging
action: replay --attachment-id f3b0e3cb-fec6-4604-a43f-32a35468ea3a --apply
replay exit code: 0
'Replayed job' record: yes
attachment status: ready
downloads: thumbnail image/jpeg (256, 160); crop image/jpeg (128, 128); optimized image/webp (320, 200)
download original: 200
original sha256 = uploaded: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
same job: 13665040-1e95-4ad3-b1fc-759bb69322d0
attempt: 2
attempt_base: 1
audit: [{'operator': 'driver-defense-faults', 'error_code': 'processing_failed', 'reason': 'source_corrupted', 'attempt': 1}]
window: replay of a ready job
upload: 202
attachment id 1ac6c769-2b55-4449-ac01-96575e6c6502
attachment status: ready
job id c5a99e2b-2a3e-4ee8-8b53-f557190b1980
action: replay --attachment-id 1ac6c769-2b55-4449-ac01-96575e6c6502 --apply
replay exit code: 3
refusal: already_ready
metadata unchanged: yes
job unchanged: 2026-10-31T13:22:43.535575+00:00
audit records: 0
driver triggers left: 0
window -> action -> job id -> attempts started -> result
after writing objects, before COMMIT -> kill worker, wait for the lease -> 89767628-2179-40d8-9d08-5a882db756e4 -> 2 -> ready
after COMMIT, before ack -> freeze and kill worker after COMMIT -> 23c4e081-66af-43a8-b9df-3b42508ea890 -> 1 -> ready, no-op
after COMMIT queued, before publish -> kill relay, upload, start relay -> 40467883-90e0-4e8a-905a-45ffe36cf2b6 -> 1 -> ready
after broker confirm, before the mark -> kill relay after confirm, duplicate -> f81f91fa-6d41-470d-9b27-a4086dc263f2 -> 1 -> ready
replay of a failed job -> failed, registry, replay -> 13665040-1e95-4ad3-b1fc-759bb69322d0 -> 2 -> ready
replay of a ready job -> replay ready -> c5a99e2b-2a3e-4ee8-8b53-f557190b1980 -> 1 -> refused, exit 3
all rows of the check table: expected = got
PASS: every window finished with the same result, no duplicate effect
worker and relay running at the end: yes
```
+25 -36
View File
@@ -1,23 +1,24 @@
# Сценарий защиты лабы 5
- Команда: `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 defense-scenario`
- Дата: 2026-10-31, 03:50 UTC; код выхода 0
- Commit: `ff1a83b` (ветка `feat/async-attachments`), рабочее дерево чистое
- Стенд: проект compose `mtusi-lab5`, собран `make run_docker` из `HEAD`: HAProxy, две реплики API, worker, cleaner, PostgreSQL, Valkey, S3, RabbitMQ
- Порядок действий (`README.md`, «Сценарий защиты», шаги 1–3): worker остановлен → загрузка 202 → сообщение с вложением 201 → скачивание 409 → текст 201 → рестарт API и хранилищ с сохранением volumes → worker запущен → `ready`, оригинал и thumbnail
- Дата: 2026-10-31, 13:23:21–13:24:00 UTC; код выхода 0
- Commit: `e2a6427` (ветка `feat/pipeline-reliability`), рабочее дерево без правок кода (добавлены только файлы `evidence/`)
- Стенд: проект compose `mtusi-lab5`, собран `make run_docker` из `HEAD`: HAProxy, две реплики API, relay, worker, cleaner, PostgreSQL, Valkey, S3, RabbitMQ
- Порядок действий (`README.md`, «Сценарий защиты», шаги 1–3): worker остановлен → загрузка 202 → сообщение с вложением 201 → скачивание 409 → текст 201 → сообщение в очереди (его опубликовал relay), 0 потребителей → рестарт API и хранилищ с сохранением volumes → worker запущен → `ready`, оригинал и три варианта. Шаг 4 — `evidence/attachments/defense-faults.md`
- Токенов и секретов в выводе нет; пользователи и чат синтетические
- Вывод сокращён: итоговая таблица «проверка → ожидаемо → получено» (34 строки, все совпали) заменена её итогом
```text
fixture sample.png: 111817 bytes, sha256 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
docker compose stop worker: 0
upload sample.png: 202
attachment id 730db74b-8e88-4ed4-bb69-0fa821f8d41e, via 3ce76b35e8aa
attachment id 0a0fe6a1-5c32-4c53-905a-43b05c6234f1, via d7f1b8c394b9
snapshot status: queued
message with the attachment: 201
message id 9716846f-448b-41c4-aebd-7b83e3264964
message id 50bc7674-f224-41c1-b060-513cad06197b
download before processing: 409
text message: 201
text message id d102d380-6f95-4712-96fb-721030ed2bf6
text message id 9c596523-2b5d-4529-9bf6-244e0e705056
job in the queue before restart: yes
queue consumers before restart: 0
scripts/restart.sh: 0
@@ -29,40 +30,28 @@ docker compose start worker: 0
attachment status: ready
download original: 200
original sha256 = uploaded: yes
variants in metadata: crop,optimized,thumbnail
download thumbnail: 200
thumbnail content type: image/jpeg
thumbnail by SOF: (256, 160)
thumbnail size by bytes: (256, 160)
thumbnail sha256 = metadata: yes
download crop: 200
crop content type: image/jpeg
crop size by bytes: (128, 128)
crop sha256 = metadata: yes
download optimized: 200
optimized content type: image/webp
optimized size by bytes: (320, 200)
optimized sha256 = metadata: yes
relay StartedAt unchanged: yes
history after restart: 200
history keeps both messages: yes
containers: StartedAt before -> after
mtusi-lab5-api-1: 2026-10-31T03:49:55.670098888Z -> 2026-10-31T03:50:35.309647378Z
mtusi-lab5-api-2: 2026-10-31T03:49:55.607322638Z -> 2026-10-31T03:50:35.244859586Z
mtusi-lab5-rabbitmq-1: 2026-10-31T03:49:47.262600342Z -> 2026-10-31T03:50:09.308230255Z
docker compose stop worker expected 0 got 0
upload sample.png expected 202 got 202
snapshot status expected queued got queued
message with the attachment expected 201 got 201
download before processing expected 409 got 409
text message expected 201 got 201
job in the queue before restart expected yes got yes
queue consumers before restart expected 0 got 0
scripts/restart.sh expected 0 got 0
LB ready after restart expected yes got yes
job in the queue after restart expected yes got yes
metadata after restart (same session) expected 200 got 200
status after restart expected queued got queued
docker compose start worker expected 0 got 0
attachment status expected ready got ready
download original expected 200 got 200
original sha256 = uploaded expected yes got yes
download thumbnail expected 200 got 200
thumbnail content type expected image/jpeg got image/jpeg
thumbnail by SOF expected (256, 160) got (256, 160)
thumbnail sha256 = metadata expected yes got yes
history after restart expected 200 got 200
history keeps both messages expected yes got yes
api and rabbitmq restarted expected yes got yes
mtusi-lab5-api-10: 2026-10-31T13:20:34.275408667Z -> 2026-10-31T13:23:49.132257549Z
mtusi-lab5-api-9: 2026-10-31T13:20:34.192033042Z -> 2026-10-31T13:23:49.056454424Z
mtusi-lab5-rabbitmq-1: 2026-10-31T13:20:26.063079844Z -> 2026-10-31T13:23:26.563060594Z
api and rabbitmq restarted: expected yes, got yes
all rows of the check table: expected = got
PASS: the file is accepted while the worker is stopped and becomes ready after the restart
worker running at the end: yes
worker and relay running at the end: yes
```
+25 -43
View File
@@ -1,66 +1,48 @@
# Принявшая реплика остановлена
- Команда: `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 attachment-failover --mode stop`, затем `make replicas` и то же с `--mode kill`
- Дата: 2026-10-31, 03:51 UTC; оба прогона — код выхода 0
- Commit: `ff1a83b`, рабочее дерево чистое
- Команда: `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 attachment-failover --mode stop`, затем то же с `--mode kill` (`make replicas` драйвер выполняет сам в `finally`)
- Дата: 2026-10-31, 13:26:45–13:26:56 UTC; оба прогона — код выхода 0
- Commit: `e2a6427` (ветка `feat/pipeline-reliability`), рабочее дерево без правок кода (добавлены только файлы `evidence/`)
- Стенд: проект compose `mtusi-lab5`, собран `make run_docker` из `HEAD`
- Сценарий: `attachments` «Принявшая реплика остановлена»
- Вывод сокращён: убраны снимки `docker compose ps` до и после (все сервисы `Up`, реплики `healthy`)
## Режим stop
## `stop`
```text
mode: stop; fixture sample.png: 111817 bytes
docker compose ps (before):
NAME STATUS
mtusi-lab5-api-1 Up 28 seconds (healthy)
mtusi-lab5-api-2 Up 28 seconds (healthy)
mtusi-lab5-cleaner-1 Up About a minute
mtusi-lab5-haproxy-1 Up 27 seconds (healthy)
mtusi-lab5-postgres-1 Up 55 seconds (healthy)
mtusi-lab5-rabbitmq-1 Up 15 seconds (healthy)
mtusi-lab5-s3-1 Up 35 seconds (healthy)
mtusi-lab5-valkey-1 Up 55 seconds (healthy)
mtusi-lab5-worker-1 Up 21 seconds
sha256 uploaded: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
sha256 downloaded: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
docker compose ps (after):
NAME STATUS
mtusi-lab5-api-1 Up 1 second (healthy)
mtusi-lab5-api-2 Up 31 seconds (healthy)
mtusi-lab5-cleaner-1 Up About a minute
mtusi-lab5-haproxy-1 Up 31 seconds (healthy)
mtusi-lab5-postgres-1 Up 58 seconds (healthy)
mtusi-lab5-rabbitmq-1 Up 18 seconds (healthy)
mtusi-lab5-s3-1 Up 38 seconds (healthy)
mtusi-lab5-valkey-1 Up 58 seconds (healthy)
mtusi-lab5-worker-1 Up 25 seconds
step expected got x-instance-id
alice uploads 202 202 3ce76b35e8aa
alice uploads 202 202 d7f1b8c394b9
attachment is ready ready ready
alice sends message 201 201 f83660c720d2
stop-one.sh stop 0 0 3ce76b35e8aa
bob downloads 200 200 f83660c720d2
bob reads metadata 200 200 f83660c720d2
eve reads metadata 404 404 f83660c720d2
eve downloads 404 404 f83660c720d2
alice sends message 201 201 e933a5daf6b3
stop-one.sh stop 0 0 d7f1b8c394b9
bob downloads 200 200 e933a5daf6b3
bob reads metadata 200 200 e933a5daf6b3
eve reads metadata 404 404 e933a5daf6b3
eve downloads 404 404 e933a5daf6b3
make replicas 0 0
LB slots UP 2 2
PASS: accepted by 3ce76b35e8aa, served by f83660c720d2 after stop, sha256 matches, outsider gets 404
PASS: accepted by d7f1b8c394b9, served by e933a5daf6b3 after stop, sha256 matches, outsider gets 404
```
## Режим kill
## `kill`
```text
mode: kill; fixture sample.png: 111817 bytes
sha256 uploaded: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
sha256 downloaded: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
step expected got x-instance-id
alice uploads 202 202 3ce76b35e8aa
alice uploads 202 202 d7f1b8c394b9
attachment is ready ready ready
alice sends message 201 201 f83660c720d2
stop-one.sh kill 0 0 3ce76b35e8aa
bob downloads 200 200 f83660c720d2
bob reads metadata 200 200 f83660c720d2
eve reads metadata 404 404 f83660c720d2
eve downloads 404 404 f83660c720d2
alice sends message 201 201 d7f1b8c394b9
stop-one.sh kill 0 0 d7f1b8c394b9
bob downloads 200 200 e933a5daf6b3
bob reads metadata 200 200 e933a5daf6b3
eve reads metadata 404 404 e933a5daf6b3
eve downloads 404 404 e933a5daf6b3
make replicas 0 0
LB slots UP 2 2
PASS: accepted by 3ce76b35e8aa, served by f83660c720d2 after kill, sha256 matches, outsider gets 404
PASS: accepted by d7f1b8c394b9, served by e933a5daf6b3 after kill, sha256 matches, outsider gets 404
```
+41 -33
View File
@@ -1,13 +1,21 @@
# Вложения: метаданные, байты и ограничения обработки
- Команда: `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 attachment-storage`
- Дата: 2026-10-31, 03:50 UTC; код выхода 0
- Commit: `ff1a83b`, рабочее дерево чистое
- Дата: 2026-10-31, 13:26:32 UTC; код выхода 0
- Commit: `e2a6427` (ветка `feat/pipeline-reliability`), рабочее дерево без правок кода (добавлены только файлы `evidence/`)
- Стенд: проект compose `mtusi-lab5`, собран `make run_docker` из `HEAD`
- Сценарии: `attachments` «Байты не в БД и не на диске API», `data-storage` «Ограничения обработки в схеме» (пробы в откатываемой транзакции)
- Сценарии: `attachments` «Байты не в БД и не на диске API», `data-storage` «Ограничения обработки в схеме» (пробы в откатываемой транзакции, с уровня 4 — ещё запись аудита с неизвестным заданием)
- Вывод сокращён: таблица второго вложения повторяет первую и совпала с ожидаемым
```text
columns of attachment tables:
attachment_job_replays id uuid
attachment_job_replays job_id uuid
attachment_job_replays operator text
attachment_job_replays error_code text
attachment_job_replays reason text
attachment_job_replays attempt integer
attachment_job_replays created_at timestamp with time zone
attachment_jobs id uuid
attachment_jobs attachment_id uuid
attachment_jobs pipeline_version integer
@@ -20,6 +28,7 @@ columns of attachment tables:
attachment_jobs updated_at timestamp with time zone
attachment_jobs finished_at timestamp with time zone
attachment_jobs created_at timestamp with time zone
attachment_jobs attempt_base integer
attachment_variants attachment_id uuid
attachment_variants pipeline_version integer
attachment_variants variant text
@@ -48,48 +57,47 @@ columns of attachment tables:
message_attachments position smallint
message_attachments attachment_id uuid
message_attachments created_at timestamp with time zone
upload via f83660c720d2: object_key messenger/attachments/3fb40419-8f7a-467a-afdf-2a4fc0153f5c/original, staging_key messenger/staging/3fb40419-8f7a-467a-afdf-2a4fc0153f5c/original
upload via d7f1b8c394b9: object_key messenger/attachments/03924317-901e-49db-bcf4-6995c907e1d4/original, staging_key messenger/staging/03924317-901e-49db-bcf4-6995c907e1d4/original
sha256 uploaded 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75, downloaded by a member (200) 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
upload via 3ce76b35e8aa: object_key messenger/attachments/40d1bf94-3ac9-417d-89ed-07430e5f4b11/original, staging_key messenger/staging/40d1bf94-3ac9-417d-89ed-07430e5f4b11/original
upload via e933a5daf6b3: object_key messenger/attachments/516e7758-6489-4538-a004-6439aae23035/original, staging_key messenger/staging/516e7758-6489-4538-a004-6439aae23035/original
sha256 uploaded 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75, downloaded by a member (200) 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
constraint probes (rolled back):
second job of the version: 23505 uq_attachment_jobs_attachment_id_pipeline_version
second variant of the name: 23505 pk_attachment_variants
error_code on not failed: 23514 ck_attachments_error_code_failed
docker diff 3ce76b35e8aa: 2 changes
replay audit of an unknown job: 23503 fk_attachment_job_replays_job_id_attachment_jobs
docker diff e933a5daf6b3: 2 changes
C /app
A /app/config.toml
docker diff f83660c720d2: 2 changes
docker diff d7f1b8c394b9: 2 changes
C /app
A /app/config.toml
docker diff f5a34a124c60: 2 changes
docker diff ecbefb38ea10: 2 changes
C /app
A /app/config.toml
bytea columns expected attachment_variants.sha256,attachments.sha256 got attachment_variants.sha256,attachments.sha256
octet_length(sha256) expected 32 got 32
object_key form expected messenger/attachments/3fb40419-8f7a-467a-afdf-2a4fc0153f5c/original got messenger/attachments/3fb40419-8f7a-467a-afdf-2a4fc0153f5c/original
staging_key form expected messenger/staging/3fb40419-8f7a-467a-afdf-2a4fc0153f5c/original got messenger/staging/3fb40419-8f7a-467a-afdf-2a4fc0153f5c/original
filename not in key expected no got no
thumbnail in bucket expected yes got yes
anonymous GET of the thumbnail expected 403 got 403
object in bucket, bytes expected 111817 got 111817
anonymous GET of the key expected 403 got 403
downloaded sha256 = uploaded expected yes got yes
object_key form expected messenger/attachments/40d1bf94-3ac9-417d-89ed-07430e5f4b11/original got messenger/attachments/40d1bf94-3ac9-417d-89ed-07430e5f4b11/original
staging_key form expected messenger/staging/40d1bf94-3ac9-417d-89ed-07430e5f4b11/original got messenger/staging/40d1bf94-3ac9-417d-89ed-07430e5f4b11/original
filename not in key expected no got no
thumbnail in bucket expected yes got yes
anonymous GET of the thumbnail expected 403 got 403
object in bucket, bytes expected 111817 got 111817
anonymous GET of the key expected 403 got 403
downloaded sha256 = uploaded expected yes got yes
probe: second job of the version expected 23505 uq_attachment_jobs_attachment_id_pipeline_version got 23505 uq_attachment_jobs_attachment_id_pipeline_version
probe: second variant of the name expected 23505 pk_attachment_variants got 23505 pk_attachment_variants
probe: error_code on not failed expected 23514 ck_attachments_error_code_failed got 23514 ck_attachments_error_code_failed
jobs | variants after the probes expected 1|1 got 1|1
original files in 3ce76b35e8aa expected 0 got 0
original files in f83660c720d2 expected 0 got 0
original files in f5a34a124c60 expected 0 got 0
bytea columns expected attachment_variants.sha256,attachments.sha256 got attachment_variants.sha256,attachments.sha256
octet_length(sha256) expected 32 got 32
object_key form expected messenger/attachments/03924317-901e-49db-bcf4-6995c907e1d4/original got messenger/attachments/03924317-901e-49db-bcf4-6995c907e1d4/original
staging_key: its form or already empty expected yes got yes
filename not in key expected no got no
variant rows expected crop,optimized,thumbnail got crop,optimized,thumbnail
crop in bucket expected yes got yes
anonymous GET of crop expected 403 got 403
optimized in bucket expected yes got yes
anonymous GET of optimized expected 403 got 403
thumbnail in bucket expected yes got yes
anonymous GET of thumbnail expected 403 got 403
object in bucket, bytes expected 111817 got 111817
anonymous GET of the key expected 403 got 403
downloaded sha256 = uploaded expected yes got yes
probe: second job of the version expected 23505 uq_attachment_jobs_attachment_id_pipeline_version got 23505 uq_attachment_jobs_attachment_id_pipeline_version
probe: second variant of the name expected 23505 pk_attachment_variants got 23505 pk_attachment_variants
probe: error_code on not failed expected 23514 ck_attachments_error_code_failed got 23514 ck_attachments_error_code_failed
probe: replay audit of an unknown job expected 23503 fk_attachment_job_replays_job_id_attachment_jobs got 23503 fk_attachment_job_replays_job_id_attachment_jobs
jobs | variants after the probes expected 1|3 got 1|3
original files in e933a5daf6b3 expected 0 got 0
original files in d7f1b8c394b9 expected 0 got 0
original files in ecbefb38ea10 expected 0 got 0
sha256 of the fixture: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
PASS: metadata in PostgreSQL, bytes only in the private bucket messenger, none in the API containers
```