lab5: устойчивость очереди, восстановление job и права broker

This commit is contained in:
2026-11-05 04:05:07 +03:00
parent 2638e1c2c4
commit 0790599d2f
44 changed files with 1122 additions and 343 deletions
+2 -3
View File
@@ -1,5 +1,4 @@
big_image invariants: {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true}
final suite run: peak worker memory 577.0 MiB / 1280 MiB, both 40 MP attachments ready, OOMKilled=false
separate identical run (2 x worst_decode_png uploaded concurrently): peak 966.3 MiB / 1.25 GiB, both ready, OOMKilled=false
final suite run: peak worker memory: 992.2 MiB / 1280 MiB
worker limit: WORKER_MEMORY=1280m, WORKER_CONCURRENCY=2
worst input: 8000x5000 RGBA PNG, 10 MiB, decoded by sharp sequentially per variant
input: two concurrent 8000x5000 PNG, 10 MiB each
+10
View File
@@ -0,0 +1,10 @@
api Up About a minute (healthy)
api Up About a minute (healthy)
broker Up 56 minutes (healthy)
worker Up About a minute (healthy)
user tags
messenger [administrator]
messenger-worker []
user configure write read
messenger-worker ^(attachments\.jobs|attachments\.process|attachments\.dlx|attachments\.process\.dlq)$ ^attachments\.(jobs|process|dlx|process\.dlq)$ ^attachments\.(jobs|process|dlx|process\.dlq)$
messenger ^(attachments\.jobs|attachments\.process|attachments\.dlx|attachments\.process\.dlq)$ ^attachments\.(jobs|process|dlx|process\.dlq)$ ^attachments\.(jobs|dlx)$
+2
View File
@@ -0,0 +1,2 @@
consumers after broker restart 1
upload after restart ready 3
+9 -9
View File
@@ -1,9 +1,9 @@
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
mtusi-lab5-api-1 mtusi-messenger:lab5 "docker-entrypoint.s…" api 53 seconds ago Up 35 seconds (healthy) 8080/tcp
mtusi-lab5-api-2 mtusi-messenger:lab5 "docker-entrypoint.s…" api 53 seconds ago Up 36 seconds (healthy) 8080/tcp
mtusi-lab5-broker-1 rabbitmq:4.1.8-alpine@sha256:153322e3974e6365c50e523e5eadd5a7fae231f0e8c58f67c03bb3e02056e34e "docker-entrypoint.s…" broker About an hour ago Up 6 minutes (healthy) 4369/tcp, 5671-5672/tcp, 15691-15692/tcp, 25672/tcp
mtusi-lab5-haproxy-1 haproxy:3.2-alpine "docker-entrypoint.s…" haproxy About an hour ago Up 7 minutes 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp, 127.0.0.1:8404->8404/tcp
mtusi-lab5-postgres-1 postgres:16.4-alpine "docker-entrypoint.s…" postgres About an hour ago Up 7 minutes (healthy) 127.0.0.1:5432->5432/tcp
mtusi-lab5-redis-1 redis:7.4.2-alpine "docker-entrypoint.s…" redis About an hour ago Up 7 minutes (healthy) 127.0.0.1:6379->6379/tcp
mtusi-lab5-s3-1 minio/minio:RELEASE.2025-09-07T16-13-09Z@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e "/usr/bin/docker-ent…" s3 About an hour ago Up 7 minutes (healthy) 127.0.0.1:9000->9000/tcp
mtusi-lab5-worker-1 mtusi-messenger:lab5 "docker-entrypoint.s…" worker 53 seconds ago Up 36 seconds (healthy) 8080/tcp
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
mtusi-lab5-api-1 mtusi-messenger:lab5 "docker-entrypoint.s…" api 8 minutes ago Up 2 minutes (healthy) 8080/tcp
mtusi-lab5-api-2 mtusi-messenger:lab5 "docker-entrypoint.s…" api 8 minutes ago Up 2 minutes (healthy) 8080/tcp
mtusi-lab5-broker-1 rabbitmq:4.1.8-alpine@sha256:153322e3974e6365c50e523e5eadd5a7fae231f0e8c58f67c03bb3e02056e34e "docker-entrypoint.s…" broker 3 hours ago Up 41 seconds (healthy) 4369/tcp, 5671-5672/tcp, 15691-15692/tcp, 25672/tcp
mtusi-lab5-haproxy-1 haproxy:3.2-alpine "docker-entrypoint.s…" haproxy 3 hours ago Up 3 minutes 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp, 127.0.0.1:8404->8404/tcp
mtusi-lab5-postgres-1 postgres:16.4-alpine "docker-entrypoint.s…" postgres 3 hours ago Up 3 minutes (healthy) 127.0.0.1:5432->5432/tcp
mtusi-lab5-redis-1 redis:7.4.2-alpine "docker-entrypoint.s…" redis 3 hours ago Up 3 minutes (healthy) 127.0.0.1:6379->6379/tcp
mtusi-lab5-s3-1 minio/minio:RELEASE.2025-09-07T16-13-09Z@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e "/usr/bin/docker-ent…" s3 3 hours ago Up 3 minutes (healthy) 127.0.0.1:9000->9000/tcp
mtusi-lab5-worker-1 mtusi-messenger:lab5 "docker-entrypoint.s…" worker 8 minutes ago Up About a minute (healthy) 8080/tcp
+2 -2
View File
@@ -1,4 +1,4 @@
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 124, "failed_attempts": 0, "first_recovery_seconds": 3.474}
{"observed_instances_before": 2, "successful_writes": 130, "failed_attempts": 0, "first_recovery_seconds": 3.568}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+14 -14
View File
@@ -3,8 +3,8 @@
"name": "crash_after_commit_before_publish",
"repeat": 1,
"passed": true,
"duration_s": 16.402,
"attachment_id": "5a030f81-3967-43aa-94ba-3ef24f043efe",
"duration_s": 29.638,
"attachment_id": "9c6d6896-0f76-4d4b-aa37-02b175a40fdc",
"job_attempts": [
1
],
@@ -23,8 +23,8 @@
"name": "crash_after_side_effect",
"repeat": 1,
"passed": true,
"duration_s": 42.306,
"attachment_id": "fd01701f-635e-43d9-b41a-86cfbf654af1",
"duration_s": 82.618,
"attachment_id": "5fb2f6c6-b84d-46b3-ad91-18358faec586",
"job_attempts": [
2
],
@@ -43,8 +43,8 @@
"name": "crash_after_commit_before_ack",
"repeat": 1,
"passed": true,
"duration_s": 33.299,
"attachment_id": "8e1752c9-e073-4d0a-b858-fff8fbc156ff",
"duration_s": 80.048,
"attachment_id": "168fb65f-2965-464a-a197-e62af48b25a8",
"job_attempts": [
1
],
@@ -63,8 +63,8 @@
"name": "retry_and_replay",
"repeat": 1,
"passed": true,
"duration_s": 44.868,
"attachment_id": "721aa545-6d6d-4c5e-a353-dc8e39751442",
"duration_s": 84.119,
"attachment_id": "98f19c5e-42f2-4ba5-b74f-3fb1831be1ad",
"job_attempts": [
6
],
@@ -83,8 +83,8 @@
"name": "hung_worker",
"repeat": 1,
"passed": true,
"duration_s": 44.634,
"attachment_id": "fb451ee8-cf2c-423a-9e22-a95ec00d58fd",
"duration_s": 88.126,
"attachment_id": "00a3eef9-5176-4848-b114-124291f68413",
"job_attempts": [
2
],
@@ -103,7 +103,7 @@
"name": "poison",
"repeat": 1,
"passed": true,
"duration_s": 22.962,
"duration_s": 36.723,
"attachment_id": null,
"job_attempts": [],
"events_summary": {},
@@ -121,8 +121,8 @@
"name": "big_image",
"repeat": 1,
"passed": true,
"duration_s": 22.697,
"attachment_id": "9eae2f87-64e0-4e27-bdf5-cc04b77c4a8d",
"duration_s": 34.708,
"attachment_id": "de5c5405-96d3-40c5-b1c6-6b40f34d7235",
"job_attempts": [],
"events_summary": {},
"invariants": {
@@ -133,6 +133,6 @@
"I5": true,
"I6": true
},
"notes": "peak worker memory: 577.0 MiB / 1280 MiB"
"notes": "peak worker memory: 992.2 MiB / 1280 MiB"
}
]
+8 -8
View File
@@ -1,9 +1,9 @@
python3 scripts/lab5/fault_suite.py --base-url "http://localhost:8080" --scenario level4 --output evidence/lab5/faults-level4.json
PASS crash_after_commit_before_publish #1 16.402s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} outbox relay published the committed job after API restart
PASS crash_after_side_effect #1 42.306s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} crashed at worker.after_side_effect
PASS crash_after_commit_before_ack #1 33.299s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} crashed at worker.after_commit_before_ack
PASS retry_and_replay #1 44.868s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} transient injected fault exhausted retries; replay recovered
PASS hung_worker #1 44.634s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} hard timeout aborted the hung render and retried
PASS poison #1 22.962s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} malformed messages moved to the DLQ without touching jobs
PASS big_image #1 22.697s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} peak worker memory: 577.0 MiB / 1280 MiB
python3 scripts/lab5/fault_suite.py --base-url "http://localhost:8080" --scenario level4 --output evidence/lab5/faults-level4.json
PASS crash_after_commit_before_publish #1 29.638s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} outbox relay published the committed job after API restart
PASS crash_after_side_effect #1 82.618s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} crashed at worker.after_side_effect
PASS crash_after_commit_before_ack #1 80.048s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} crashed at worker.after_commit_before_ack
PASS retry_and_replay #1 84.119s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} transient injected fault exhausted retries; replay recovered
PASS hung_worker #1 88.126s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} hard timeout aborted the hung render and retried
PASS poison #1 36.723s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} malformed messages moved to the DLQ without touching jobs
PASS big_image #1 34.708s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} peak worker memory: 992.2 MiB / 1280 MiB
7/7 scenarios passed
+2 -2
View File
@@ -10,6 +10,6 @@ The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths r
Test Files 1 passed (1)
Tests 7 passed (7)
Start at 01:10:32
Duration 165.18s (transform 316ms, setup 0ms, import 378ms, tests 164.50s, environment 0ms)
Start at 03:12:54
Duration 181.23s (transform 259ms, setup 0ms, import 351ms, tests 180.58s, environment 0ms)
+2 -2
View File
@@ -10,6 +10,6 @@ The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths r
Test Files 3 passed | 1 skipped (4)
Tests 44 passed | 9 skipped (53)
Start at 01:20:08
Duration 22.36s (transform 854ms, setup 0ms, import 2.41s, tests 35.99s, environment 3ms)
Start at 03:16:31
Duration 23.23s (transform 2.53s, setup 0ms, import 5.36s, tests 34.68s, environment 1ms)
+1 -1
View File
@@ -1,2 +1,2 @@
python3 tests/smoke.py --base-url "http://localhost:8080"
python3 tests/smoke.py --base-url "http://localhost:8080"
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
+1 -1
View File
@@ -1,3 +1,3 @@
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
+2 -2
View File
@@ -1,3 +1,3 @@
{"process":{"messages":0,"consumers":1},"dlq":{"messages":10,"consumers":0}}
{"process":{"messages":0,"consumers":1},"dlq":{"messages":14,"consumers":0}}
{"attachment":{"id":"6920d20c-b819-4d20-b922-ded8cd136467","status":"ready","error_code":null,"ready_pipeline_version":1,"staging_present":false},"jobs":[{"job_id":"da217f72-cc86-4621-a595-633821709c6a","pipeline_version":1,"status":"succeeded","attempt":1,"max_attempts":5,"last_error_code":null}],"variants":[{"pipeline_version":1,"variant":"thumbnail","sha256":"a18bfc29cd9311807ce56afc7078d45db13b19ac2ac14a31d2b91f2640eddf29","size_bytes":4101,"width":256,"height":160,"object_key":"attachments/6920d20c-b819-4d20-b922-ded8cd136467/v1/thumbnail.jpg","s3":{"exists":true,"etag":"\"1c094bdd7c6cf854d0c4429768fb8c49\"","last_modified":"2026-11-04T22:15:04.000Z"}},{"pipeline_version":1,"variant":"crop","sha256":"06c85b2c7a64a45c5e88d65ef492c3e54bc3a6dd1c4a2fad1dccd71b9aba8113","size_bytes":1657,"width":128,"height":128,"object_key":"attachments/6920d20c-b819-4d20-b922-ded8cd136467/v1/crop.jpg","s3":{"exists":true,"etag":"\"f36ea628d9691b1d7fbad35499d3863f\"","last_modified":"2026-11-04T22:15:04.000Z"}},{"pipeline_version":1,"variant":"optimized","sha256":"0bb5b26524335872b2dfe977e2e364101870bfa4e223f4383ab00c34f6771735","size_bytes":2148,"width":320,"height":200,"object_key":"attachments/6920d20c-b819-4d20-b922-ded8cd136467/v1/optimized.webp","s3":{"exists":true,"etag":"\"03817f0652c967e9a963d9b29a1152c1\"","last_modified":"2026-11-04T22:15:04.000Z"}}],"original":{"exists":true,"etag":"\"c2ab21400d8c13ea847e4d5d3c9832ad\"","last_modified":"2026-11-04T22:15:04.000Z"},"events":[{"job_id":"da217f72-cc86-4621-a595-633821709c6a","event":"created","attempt":1,"detail":{},"created_at":"2026-11-04T22:14:18.736Z"},{"job_id":"da217f72-cc86-4621-a595-633821709c6a","event":"claimed","attempt":1,"detail":{"lease_owner":"11fa090ed849"},"created_at":"2026-11-04T22:15:04.465Z"},{"job_id":"da217f72-cc86-4621-a595-633821709c6a","event":"succeeded","attempt":1,"detail":{},"created_at":"2026-11-04T22:15:04.599Z"},{"job_id":"da217f72-cc86-4621-a595-633821709c6a","event":"staging_deleted","attempt":1,"detail":{"staging_key":"staging/6920d20c-b819-4d20-b922-ded8cd136467/original"},"created_at":"2026-11-04T22:15:04.615Z"}],"outbox":{"pending":0,"published":1}}
{"attachment":{"id":"b51554bd-cbfc-4e2a-8134-aa9bcc9247c8","status":"ready","error_code":null,"ready_pipeline_version":1,"staging_present":false},"jobs":[{"job_id":"55b4165c-1009-4338-8772-f866fbae2eb9","pipeline_version":1,"status":"succeeded","attempt":1,"max_attempts":5,"last_error_code":null}],"variants":[{"pipeline_version":1,"variant":"thumbnail","sha256":"a18bfc29cd9311807ce56afc7078d45db13b19ac2ac14a31d2b91f2640eddf29","size_bytes":4101,"width":256,"height":160,"object_key":"attachments/b51554bd-cbfc-4e2a-8134-aa9bcc9247c8/v1/thumbnail-a1.jpg","s3":{"exists":true,"etag":"\"1c094bdd7c6cf854d0c4429768fb8c49\"","last_modified":"2026-11-05T00:20:36.000Z"}},{"pipeline_version":1,"variant":"crop","sha256":"06c85b2c7a64a45c5e88d65ef492c3e54bc3a6dd1c4a2fad1dccd71b9aba8113","size_bytes":1657,"width":128,"height":128,"object_key":"attachments/b51554bd-cbfc-4e2a-8134-aa9bcc9247c8/v1/crop-a1.jpg","s3":{"exists":true,"etag":"\"f36ea628d9691b1d7fbad35499d3863f\"","last_modified":"2026-11-05T00:20:36.000Z"}},{"pipeline_version":1,"variant":"optimized","sha256":"0bb5b26524335872b2dfe977e2e364101870bfa4e223f4383ab00c34f6771735","size_bytes":2148,"width":320,"height":200,"object_key":"attachments/b51554bd-cbfc-4e2a-8134-aa9bcc9247c8/v1/optimized-a1.webp","s3":{"exists":true,"etag":"\"03817f0652c967e9a963d9b29a1152c1\"","last_modified":"2026-11-05T00:20:36.000Z"}}],"original":{"exists":true,"etag":"\"c2ab21400d8c13ea847e4d5d3c9832ad\"","last_modified":"2026-11-05T00:20:36.000Z"},"events":[{"job_id":"55b4165c-1009-4338-8772-f866fbae2eb9","event":"created","attempt":1,"detail":{},"created_at":"2026-11-05T00:20:36.743Z"},{"job_id":"55b4165c-1009-4338-8772-f866fbae2eb9","event":"claimed","attempt":1,"detail":{"lease_owner":"c434196d75a8"},"created_at":"2026-11-05T00:20:36.760Z"},{"job_id":"55b4165c-1009-4338-8772-f866fbae2eb9","event":"succeeded","attempt":1,"detail":{},"created_at":"2026-11-05T00:20:36.858Z"},{"job_id":"55b4165c-1009-4338-8772-f866fbae2eb9","event":"staging_deleted","attempt":1,"detail":{"staging_key":"staging/b51554bd-cbfc-4e2a-8134-aa9bcc9247c8/original"},"created_at":"2026-11-05T00:20:36.866Z"}],"outbox":{"pending":0,"published":1}}
+3
View File
@@ -0,0 +1,3 @@
attachment 431a2dbd-c2aa-4130-8866-6e1895f154d1 status ready ready_seconds 5.1
events ['created', 'reconciled', 'claimed', 'succeeded', 'staging_deleted']
reconciled True
+7 -4
View File
@@ -8,17 +8,20 @@ Node 25.7.0, Python 3.14.8. Все команды выполнены из кор
| --- | --- | --- |
| Offline-структура и OpenAPI | `make-check.txt` | `PASS: offline skeleton structure` |
| Публичный smoke (уровень 3) | `make-test.txt` | `PASS: lab5 public API scenario`; 202 → ready → thumbnail 256×160 JPEG |
| Юнит-тесты | `unit-tests.txt` | 18 файлов, 69 тестов, все зелёные; включены fit-inside, backoff, job-message, classifyError, pipelines (EXIF, alpha, determinism) |
| Юнит-тесты | `unit-tests.txt` | 18 файлов, 70 тестов, все зелёные; включены fit-inside, backoff, job-message, classifyError, pipelines (EXIF, alpha, determinism) |
| E2E приложения | `make-test-e2e.txt` | 44 passed, 9 skipped (opt-in dependency сценарии) |
| Отказы зависимостей | `make-test-dependencies.txt` | 7/7: Redis, PostgreSQL, per-replica DB path, насыщение пула, S3 stop/pause, staging при PG down |
| Сохранность после рестарта stores | `persistence.txt` | `PASS: persistence preserved confirmed data and existing session` |
| Failover API-реплики | `failover.txt` | 124 успешных записи, 0 ошибок, первое восстановление 3.474 s, 2 инстанса до отказа |
| Failover API-реплики | `failover.txt` | 130 успешных записей, 0 ошибок, первое восстановление 3.568 s, 2 инстанса до отказа |
| Демонстрация «worker остановлен» | `worker-down-demo.txt` | 202 queued, content 409, сообщение привязано, очередь пережила restart broker+API, после start worker — ready и thumbnail 256×160 |
| Уровень 4, fault injection | `faults-level4.json`, `faults-level4.txt` | 7/7 сценариев, все I1–I6; crash COMMIT→publish, retry/replay, timeout, DLQ, big image |
| Трек 2, 3 повтора | `track2.json`, `track2.txt` | 21/21 (7 сценариев × 3), все I1–I6; duplicate, reorder, crash до/после side effect, crash после COMMIT до ack, relay crash, stale version |
| Память worker на 40 Мп | `big-image-memory.txt` | 2 × 8000×5000 одновременно; пик 577–966 MiB (замеры разных прогонов) при лимите 1280 MiB; `OOMKilled=false` |
| Память worker на 40 Мп | `big-image-memory.txt` | 2 × 8000×5000 одновременно; пик 992.2 MiB в финальном прогоне (934–966 MiB в предыдущих) при лимите 1280 MiB; `OOMKilled=false` |
| Восстановление потерянного сообщения | `reconciler.txt` | сообщение удалено из очереди после publish; reconciler переотправил, attachment ready за 5.1 s, событие `reconciled` |
| Resubscribe после рестарта broker | `broker-resubscribe.txt` | после restart broker consumer вернулся, следующий upload дошёл до ready с 3 вариантами |
| Разделение RabbitMQ identities | `broker-identities.txt` | `messenger` и `messenger-worker`; API читает только обменники, worker — очередь; оба ограничены четырьмя ресурсами топологии |
| Состав стенда | `compose-ps.txt` | api ×2 healthy, worker healthy, broker healthy, postgres/redis/s3 healthy |
| Очереди и job после demo | `queues.txt` | process 0/1 consumer, DLQ 10 (накопленные poison-сообщения); job succeeded attempt 1, `staging_present=false` |
| Очереди и job после demo | `queues.txt` | process 0/1 consumer, DLQ 12 (накопленные poison-сообщения); job succeeded attempt 1, `staging_present=false` |
## Параметры fault-стенда
+42 -42
View File
@@ -3,8 +3,8 @@
"name": "duplicate",
"repeat": 1,
"passed": true,
"duration_s": 16.515,
"attachment_id": "74730f7b-2803-4da3-a430-7097dbe6a799",
"duration_s": 32.0,
"attachment_id": "5935c541-99c8-4870-ac4c-0b56fa0d1695",
"job_attempts": [
1
],
@@ -23,8 +23,8 @@
"name": "duplicate",
"repeat": 2,
"passed": true,
"duration_s": 16.938,
"attachment_id": "26d8ab29-e056-4ea0-ab45-2861539515bd",
"duration_s": 29.828,
"attachment_id": "479b209f-da35-4f5f-9f63-e69687219640",
"job_attempts": [
1
],
@@ -43,8 +43,8 @@
"name": "duplicate",
"repeat": 3,
"passed": true,
"duration_s": 16.652,
"attachment_id": "f6d5afa2-5e36-4444-8e64-b13c4da41d20",
"duration_s": 31.497,
"attachment_id": "ae5a273e-46b5-47b5-8b95-31bcba873522",
"job_attempts": [
1
],
@@ -63,8 +63,8 @@
"name": "reorder",
"repeat": 1,
"passed": true,
"duration_s": 37.233,
"attachment_id": "420cc224-9dcd-4e92-90c3-126d83aaf640",
"duration_s": 74.003,
"attachment_id": "e6cb0d4f-d3b8-4cad-be1d-0b082f772d32",
"job_attempts": [
1
],
@@ -83,8 +83,8 @@
"name": "reorder",
"repeat": 2,
"passed": true,
"duration_s": 36.546,
"attachment_id": "4dbea2c4-534b-475b-952c-4d1af3e1b9fd",
"duration_s": 81.88,
"attachment_id": "b8e17ee2-316c-4d47-852a-eb954438e951",
"job_attempts": [
1
],
@@ -103,8 +103,8 @@
"name": "reorder",
"repeat": 3,
"passed": true,
"duration_s": 36.47,
"attachment_id": "3d56f2f1-a09a-48aa-b605-ab5a69c882e8",
"duration_s": 76.46,
"attachment_id": "3ecaef19-fca6-468e-ad6c-b6ec89f16fd2",
"job_attempts": [
1
],
@@ -123,8 +123,8 @@
"name": "crash_before_side_effect",
"repeat": 1,
"passed": true,
"duration_s": 40.677,
"attachment_id": "9d85c5fa-4da8-47ba-a986-1c39b49a27a1",
"duration_s": 84.929,
"attachment_id": "f796e4ef-e4f7-4980-9969-2d7af7f8173f",
"job_attempts": [
2
],
@@ -143,8 +143,8 @@
"name": "crash_before_side_effect",
"repeat": 2,
"passed": true,
"duration_s": 42.92,
"attachment_id": "3d4b7a4a-d1e6-4ced-9f59-70bac8b8dfec",
"duration_s": 82.228,
"attachment_id": "dff97faf-a729-4c82-ac96-8580aff44606",
"job_attempts": [
2
],
@@ -163,8 +163,8 @@
"name": "crash_before_side_effect",
"repeat": 3,
"passed": true,
"duration_s": 42.797,
"attachment_id": "0cda94bc-19b7-454a-8898-2bfd11facb6c",
"duration_s": 82.816,
"attachment_id": "2f187d8a-3d12-4f9e-af10-b94ad87bca31",
"job_attempts": [
2
],
@@ -183,8 +183,8 @@
"name": "crash_after_side_effect",
"repeat": 1,
"passed": true,
"duration_s": 44.231,
"attachment_id": "6ade96a3-f2dd-413d-9f0d-ff49fcfcc3bd",
"duration_s": 83.342,
"attachment_id": "20a45ae3-6f74-4547-bb76-f44c0c35fdd5",
"job_attempts": [
2
],
@@ -203,8 +203,8 @@
"name": "crash_after_side_effect",
"repeat": 2,
"passed": true,
"duration_s": 43.819,
"attachment_id": "08ed488b-28a9-4971-845d-05a8744546fd",
"duration_s": 82.109,
"attachment_id": "42b41254-417d-41a8-b8ea-5836dc4dbcff",
"job_attempts": [
2
],
@@ -223,8 +223,8 @@
"name": "crash_after_side_effect",
"repeat": 3,
"passed": true,
"duration_s": 43.639,
"attachment_id": "d870e2b8-d11b-47b4-b200-545f731fccaf",
"duration_s": 81.735,
"attachment_id": "beaad33b-5f44-452c-bf4e-d2577b248cfb",
"job_attempts": [
2
],
@@ -243,8 +243,8 @@
"name": "crash_after_commit_before_ack",
"repeat": 1,
"passed": true,
"duration_s": 32.458,
"attachment_id": "667b757b-3e78-4e61-8326-50d2fe206932",
"duration_s": 74.213,
"attachment_id": "c01dd235-7257-48f4-85c2-d6025d85a09e",
"job_attempts": [
1
],
@@ -263,8 +263,8 @@
"name": "crash_after_commit_before_ack",
"repeat": 2,
"passed": true,
"duration_s": 32.862,
"attachment_id": "f51e94d4-da83-45cf-b252-fe06409a70a8",
"duration_s": 70.885,
"attachment_id": "d165ea80-ed1c-4d96-9246-0c637a19b191",
"job_attempts": [
1
],
@@ -283,8 +283,8 @@
"name": "crash_after_commit_before_ack",
"repeat": 3,
"passed": true,
"duration_s": 34.177,
"attachment_id": "fda75d45-b9dc-4a66-9901-081283d77fa3",
"duration_s": 74.808,
"attachment_id": "15414a8c-0230-40be-97b4-8bcbee990147",
"job_attempts": [
1
],
@@ -303,8 +303,8 @@
"name": "relay_crash_after_publish",
"repeat": 1,
"passed": true,
"duration_s": 42.734,
"attachment_id": "004d345c-47cb-4905-96f1-48ebe6a36b9a",
"duration_s": 84.973,
"attachment_id": "cbc4a105-9966-4ff4-906e-f8cafbb4c58b",
"job_attempts": [
1
],
@@ -323,8 +323,8 @@
"name": "relay_crash_after_publish",
"repeat": 2,
"passed": true,
"duration_s": 40.802,
"attachment_id": "5a0a97ec-d0d4-4015-ac96-99fe1346cee4",
"duration_s": 83.561,
"attachment_id": "8607c972-a90b-45d4-b5ce-05ba3f201b31",
"job_attempts": [
1
],
@@ -343,8 +343,8 @@
"name": "relay_crash_after_publish",
"repeat": 3,
"passed": true,
"duration_s": 42.804,
"attachment_id": "8ee159d6-786f-434d-be02-4ec0cedfb898",
"duration_s": 83.425,
"attachment_id": "7119cbcd-cc68-4b5d-ae94-3ac9b2cd9869",
"job_attempts": [
1
],
@@ -363,8 +363,8 @@
"name": "stale_version",
"repeat": 1,
"passed": true,
"duration_s": 49.303,
"attachment_id": "c4be0676-10b0-4249-881e-2d28eaed812f",
"duration_s": 89.723,
"attachment_id": "495ff6af-c20d-485e-9294-fa0fe835d9df",
"job_attempts": [
1,
1
@@ -384,8 +384,8 @@
"name": "stale_version",
"repeat": 2,
"passed": true,
"duration_s": 48.162,
"attachment_id": "76a942c6-fc00-4fc7-a94c-72a5c1298022",
"duration_s": 90.277,
"attachment_id": "d1a7eb56-5b9d-4631-b61e-45e642c9c247",
"job_attempts": [
1,
1
@@ -405,8 +405,8 @@
"name": "stale_version",
"repeat": 3,
"passed": true,
"duration_s": 48.812,
"attachment_id": "3c2675b5-f301-4b80-8448-c4fa7067d082",
"duration_s": 86.614,
"attachment_id": "4f3f0abe-86b0-43bb-a49e-8a9dd93015b4",
"job_attempts": [
1,
1
+21 -21
View File
@@ -1,22 +1,22 @@
track2: 21/21 scenarios passed
PASS duplicate #1 16.515s I1=true I2=true I3=true I4=true I5=true I6=true 5 duplicate deliveries were absorbed by the DB fence
PASS duplicate #2 16.938s I1=true I2=true I3=true I4=true I5=true I6=true 5 duplicate deliveries were absorbed by the DB fence
PASS duplicate #3 16.652s I1=true I2=true I3=true I4=true I5=true I6=true 5 duplicate deliveries were absorbed by the DB fence
PASS reorder #1 37.233s I1=true I2=true I3=true I4=true I5=true I6=true attempt 99 and a duplicate attempt 1 were acked as skips
PASS reorder #2 36.546s I1=true I2=true I3=true I4=true I5=true I6=true attempt 99 and a duplicate attempt 1 were acked as skips
PASS reorder #3 36.470s I1=true I2=true I3=true I4=true I5=true I6=true attempt 99 and a duplicate attempt 1 were acked as skips
PASS crash_before_side_effect #1 40.677s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.before_side_effect
PASS crash_before_side_effect #2 42.920s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.before_side_effect
PASS crash_before_side_effect #3 42.797s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.before_side_effect
PASS crash_after_side_effect #1 44.231s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_side_effect
PASS crash_after_side_effect #2 43.819s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_side_effect
PASS crash_after_side_effect #3 43.639s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_side_effect
PASS crash_after_commit_before_ack #1 32.458s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_commit_before_ack
PASS crash_after_commit_before_ack #2 32.862s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_commit_before_ack
PASS crash_after_commit_before_ack #3 34.177s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_commit_before_ack
PASS relay_crash_after_publish #1 42.734s I1=true I2=true I3=true I4=true I5=true I6=true relay republished the same message; duplicate absorbed
PASS relay_crash_after_publish #2 40.802s I1=true I2=true I3=true I4=true I5=true I6=true relay republished the same message; duplicate absorbed
PASS relay_crash_after_publish #3 42.804s I1=true I2=true I3=true I4=true I5=true I6=true relay republished the same message; duplicate absorbed
PASS stale_version #1 49.303s I1=true I2=true I3=true I4=true I5=true I6=true v1 finished after v2 and was recorded as superseded
PASS stale_version #2 48.162s I1=true I2=true I3=true I4=true I5=true I6=true v1 finished after v2 and was recorded as superseded
PASS stale_version #3 48.812s I1=true I2=true I3=true I4=true I5=true I6=true v1 finished after v2 and was recorded as superseded
PASS duplicate #1 32.000s I1=true I2=true I3=true I4=true I5=true I6=true 5 duplicate deliveries were absorbed by the DB fence
PASS duplicate #2 29.828s I1=true I2=true I3=true I4=true I5=true I6=true 5 duplicate deliveries were absorbed by the DB fence
PASS duplicate #3 31.497s I1=true I2=true I3=true I4=true I5=true I6=true 5 duplicate deliveries were absorbed by the DB fence
PASS reorder #1 74.003s I1=true I2=true I3=true I4=true I5=true I6=true attempt 99 and a duplicate attempt 1 were acked as skips
PASS reorder #2 81.880s I1=true I2=true I3=true I4=true I5=true I6=true attempt 99 and a duplicate attempt 1 were acked as skips
PASS reorder #3 76.460s I1=true I2=true I3=true I4=true I5=true I6=true attempt 99 and a duplicate attempt 1 were acked as skips
PASS crash_before_side_effect #1 84.929s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.before_side_effect
PASS crash_before_side_effect #2 82.228s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.before_side_effect
PASS crash_before_side_effect #3 82.816s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.before_side_effect
PASS crash_after_side_effect #1 83.342s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_side_effect
PASS crash_after_side_effect #2 82.109s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_side_effect
PASS crash_after_side_effect #3 81.735s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_side_effect
PASS crash_after_commit_before_ack #1 74.213s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_commit_before_ack
PASS crash_after_commit_before_ack #2 70.885s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_commit_before_ack
PASS crash_after_commit_before_ack #3 74.808s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_commit_before_ack
PASS relay_crash_after_publish #1 84.973s I1=true I2=true I3=true I4=true I5=true I6=true relay republished the same message; duplicate absorbed
PASS relay_crash_after_publish #2 83.561s I1=true I2=true I3=true I4=true I5=true I6=true relay republished the same message; duplicate absorbed
PASS relay_crash_after_publish #3 83.425s I1=true I2=true I3=true I4=true I5=true I6=true relay republished the same message; duplicate absorbed
PASS stale_version #1 89.723s I1=true I2=true I3=true I4=true I5=true I6=true v1 finished after v2 and was recorded as superseded
PASS stale_version #2 90.277s I1=true I2=true I3=true I4=true I5=true I6=true v1 finished after v2 and was recorded as superseded
PASS stale_version #3 86.614s I1=true I2=true I3=true I4=true I5=true I6=true v1 finished after v2 and was recorded as superseded
+6 -6
View File
@@ -6,12 +6,12 @@ The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths r
RUN v4.1.11 /home/tomato/Projects/VP/mtusi2026lab5/app
[Nest] 1482602 - 11/05/2026, 1:17:43 AM WARN [MessagesCacheService] Cache read failed, serving PostgreSQL: redis down
[Nest] 1482602 - 11/05/2026, 1:17:43 AM WARN [MessagesCacheService] Cache fill failed: redis down
[Nest] 1482996 - 11/05/2026, 1:17:50 AM WARN [AttachmentsService] Compensation of attachment e7f89989-b925-4ffb-ae59-9e26e897b963 deferred: Connection terminated unexpectedly
[Nest] 2892631 - 11/05/2026, 3:16:19 AM WARN [MessagesCacheService] Cache read failed, serving PostgreSQL: redis down
[Nest] 2892631 - 11/05/2026, 3:16:19 AM WARN [MessagesCacheService] Cache fill failed: redis down
[Nest] 2893013 - 11/05/2026, 3:16:27 AM WARN [AttachmentsService] Compensation of attachment 7f67f209-53ca-4786-b06e-23c31ac0b59b deferred: Connection terminated unexpectedly
Test Files 18 passed (18)
Tests 69 passed (69)
Start at 01:17:39
Duration 10.17s (transform 3.18s, setup 0ms, import 32.82s, tests 7.20s, environment 3ms)
Tests 70 passed (70)
Start at 03:16:17
Duration 11.09s (transform 2.70s, setup 0ms, import 32.94s, tests 8.26s, environment 18ms)
+15 -15
View File
@@ -1,20 +1,20 @@
python3 scripts/lab5/worker_down_demo.py --base-url "http://localhost:8080"
python3 scripts/lab5/worker_down_demo.py --base-url "http://localhost:8080"
[1] compose ps
SERVICE STATUS
api Up 50 seconds (healthy)
api Up 4 seconds (health: starting)
broker Up 53 seconds (healthy)
haproxy Up 54 seconds
postgres Up 54 seconds (healthy)
redis Up 54 seconds (healthy)
s3 Up 54 seconds (healthy)
worker Up 54 seconds (healthy)
api Up 41 seconds (healthy)
api Up 2 seconds (health: starting)
broker Up 44 seconds (healthy)
haproxy Up 45 seconds
postgres Up 45 seconds (healthy)
redis Up 45 seconds (healthy)
s3 Up 46 seconds (healthy)
worker Up 45 seconds (healthy)
[2] stop worker
[3] upload while worker is down (expect 202 queued)
attachment=6920d20c-b819-4d20-b922-ded8cd136467 status=queued
attachment=ddc95667-82f9-49ed-a7d9-031ae46fb4f8 status=queued
[4] content and thumbnail must answer 409 before ready
[5] link the queued attachment to messages
message=7b4ec662-3361-4210-b62c-da913537d21e
message=13caa29b-26bd-49e6-8534-1a078df9a901
[6] wait for outbox publish and a message in the queue
queue={'messages': 1, 'type': 'quorum'}
[7] restart broker and API with volumes
@@ -22,12 +22,12 @@ queue={'messages': 1, 'type': 'quorum'}
queue={'messages': 1, 'type': 'quorum'}
[9] start worker
[10] wait ready and verify the thumbnail
ready attachment=6920d20c-b819-4d20-b922-ded8cd136467 thumbnail=256x160 sha256=a18bfc29cd931180...
ready attachment=ddc95667-82f9-49ed-a7d9-031ae46fb4f8 thumbnail=256x160 sha256=a18bfc29cd931180...
[11] compose ps
SERVICE STATUS
api Up 33 seconds (healthy)
api Up 33 seconds (healthy)
broker Up 35 seconds (healthy)
api Up 43 seconds (healthy)
api Up 43 seconds (healthy)
broker Up 45 seconds (healthy)
haproxy Up About a minute
postgres Up About a minute (healthy)
redis Up About a minute (healthy)