lab 4 na 4

This commit is contained in:
2026-11-05 13:52:11 +03:00
parent 14166003b8
commit f6292ac308
48 changed files with 2255 additions and 183 deletions
+20
View File
@@ -0,0 +1,20 @@
PASS 00-up
PASS 01-go-tests
PASS 02-make-check
PASS 03-make-test
PASS 04-lb
PASS 05-edge
PASS 06-attachments
PASS 07-s3-rights
PASS 08-s3-init-twice
PASS 09-orphans
PASS 10-memory-1mb
PASS 11-memory-9mb
PASS 12-att-failover-1
PASS 13-att-failover-2
PASS 14-persistence
PASS 15-failover-1
PASS 16-failover-2
PASS 17-infra
FAIL 18-rolling
+4
View File
@@ -0,0 +1,4 @@
uploaded via instance 01a59faf45f5 sha256 8c0b92dee2f27e38753f6ff06bbecf78a2727c92f26797e4e49126eb6d4d1be1
stopped 01a59faf45f5
downloaded 10x via ['e4222fff9061'] - sha256 matches; stopped instance served: False
restored
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 4,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 80.0,
"elapsed_seconds": 80.05,
"concurrency": 4,
"successful_requests": 54199,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 677.061,
"successful_latency_ms": {
"p50": 3.305,
"p95": 35.789,
"p99": 50.011
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 4,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 80.0,
"elapsed_seconds": 80.05,
"concurrency": 4,
"successful_requests": 54199,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 677.061,
"successful_latency_ms": {
"p50": 3.305,
"p95": 35.789,
"p99": 50.011
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+15
View File
@@ -0,0 +1,15 @@
{
"payload_bytes": 999476,
"statuses": {
"201": 628
},
"idle_mib": {
"mtusi2026lab4-api-2": 82.43,
"mtusi2026lab4-api-1": 85.0
},
"peak_mib": {
"mtusi2026lab4-api-2": 135.9,
"mtusi2026lab4-api-1": 139.1
},
"limit_mib": 256
}
+16
View File
@@ -0,0 +1,16 @@
{
"payload_bytes": 9435932,
"statuses": {
"503": 6,
"201": 36
},
"idle_mib": {
"mtusi2026lab4-api-2": 117.7,
"mtusi2026lab4-api-1": 122.3
},
"peak_mib": {
"mtusi2026lab4-api-2": 169.9,
"mtusi2026lab4-api-1": 186.7
},
"limit_mib": 256
}
+9
View File
@@ -0,0 +1,9 @@
== A: PUT прошёл, запись метаданных упала -> компенсация
objects before: 887
ALTER TABLE
upload status: 500
api-3 | 2026/11/05 10:33:51 attachment metadata insert failed, compensating: ERROR: new row for relation "attachments" violates check constraint "inject_fail" (SQLSTATE 23514)
(сбоев компенсации нет)
ALTER TABLE
objects after: 887
PASS: объект не остался
+11
View File
@@ -0,0 +1,11 @@
== B: объект без записи в БД (имитация падения между PUT и INSERT)
-- grace=1h: свежий объект не трогается
2026/11/05 10:34:21 reconcile: scanned=887 young=425 orphans=0 deleted=0 missing=0 dry_run=true took=199ms err=<nil>
-- grace=1s, dry-run: найден, но не удалён
2026/11/05 10:34:35 orphan (dry-run, not deleted): attachments/00000000-0000-4000-8000-000000000000/11111111-1111-4111-8111-111111111111
2026/11/05 10:34:35 reconcile: scanned=887 young=0 orphans=1 deleted=0 missing=0 dry_run=true took=240ms err=<nil>
2
-- grace=1s, реальный запуск: удалён
2026/11/05 10:34:52 orphan deleted: attachments/00000000-0000-4000-8000-000000000000/11111111-1111-4111-8111-111111111111
2026/11/05 10:34:52 reconcile: scanned=887 young=0 orphans=1 deleted=1 missing=0 dry_run=false took=50ms err=<nil>
2026-11-05 10:25:07 999476 attachments/49a475be-019d-48d0-a0ec-606b92d35161/6d51b15a-446a-445f-8774-af909c971111
+4
View File
@@ -0,0 +1,4 @@
== C: объект потерян, метаданные остались
удаляем объект attachments/0170aa0f-9f15-4495-ae81-e0dd39a1e784/af279bf1-4af8-44b7-931b-b65f8a65048e (тестовое вложение)
2026/11/05 10:35:11 MISSING object for attachment id=af279bf1-4af8-44b7-931b-b65f8a65048e key=attachments/0170aa0f-9f15-4495-ae81-e0dd39a1e784/af279bf1-4af8-44b7-931b-b65f8a65048e (metadata kept, needs manual decision)
2026/11/05 10:35:12 reconcile: scanned=886 young=0 orphans=0 deleted=0 missing=1 dry_run=true took=1.244s err=<nil>
+6
View File
@@ -0,0 +1,6 @@
== D: обрыв загрузки клиентом (заявлено 5 МБ, отправлено 300 КБ)
objects before: 887
aborted upload after 300 KB of 5000000
objects after: 887
PASS: в S3 ничего не записано
service "api" is not running container #1
+9
View File
@@ -0,0 +1,9 @@
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
mtusi2026lab4-api-3 mtusi2026lab4-api "./api" api About a minute ago Up About a minute (healthy) 8080/tcp
mtusi2026lab4-api-4 mtusi2026lab4-api "./api" api About a minute ago Up About a minute (healthy) 8080/tcp
mtusi2026lab4-lb-1 haproxy:3.0-alpine "docker-entrypoint.s…" lb 36 minutes ago Up 3 minutes 127.0.0.1:8080->8080/tcp
mtusi2026lab4-postgres-1 postgres:16.4-alpine "docker-entrypoint.s…" postgres 36 minutes ago Up 3 minutes (healthy) 5432/tcp
mtusi2026lab4-reconciler-1 sha256:57946a358c790ffdba5c77418a7c9daaebda7f7434b93e71484671ce776c9f87 "./reconcile -loop=1…" reconciler 36 minutes ago Up 36 minutes 8080/tcp
mtusi2026lab4-redis-1 redis:7.4-alpine "docker-entrypoint.s…" redis 36 minutes ago Up 3 minutes (healthy) 6379/tcp
mtusi2026lab4-s3-proxy-1 haproxy:3.0-alpine "docker-entrypoint.s…" s3-proxy 36 minutes ago Up 3 minutes
mtusi2026lab4-seaweedfs-1 chrislusf/seaweedfs:4.50 "/entrypoint.sh serv…" seaweedfs 36 minutes ago Up 3 minutes (healthy) 7333/tcp, 8080/tcp, 8333/tcp, 8888/tcp, 9333/tcp, 18080/tcp, 18888/tcp, 19333/tcp
+6
View File
@@ -0,0 +1,6 @@
upload: 201 adbb25e9-e374-48f5-837b-a86a5690dcd3
restart seaweedfs returned after 3.5s
t= 7.9s status=503 bytes_ok=False took=4.4s
t= 14.0s TimeoutError took=5.0s
t= 20.0s TimeoutError took=5.0s
t= 21.2s status=200 bytes_ok=True took=0.2s
+15
View File
@@ -0,0 +1,15 @@
PASS api: список объектов бакета (ok)
PASS api: запись объекта (ok)
PASS api: удаление объекта (ok)
PASS api: создание другого бакета (deny)
PASS api: удаление бакета (deny)
PASS admin: создание бакета (bootstrap) (ok)
--- без подписи (anonymous)
PASS anonymous http://s3-proxy:8333/attachments/ -> 403
PASS anonymous http://s3-proxy:8333/attachments/attachments/x/y -> 403
--- консоли управления из контейнера api (ожидается недоступность)
PASS api -> seaweedfs:9333 недоступен
PASS api -> seaweedfs:8888 недоступен
PASS api -> seaweedfs:8080 недоступен
PASS api -> s3-proxy:9333 недоступен
PASS api -> s3-proxy:8888 недоступен