ЛР 4 — БПИ2303 — Лазарев — на 4
Перенос lab3 и вложения в приватном S3 (SeaweedFS 4.50).
- POST /chats/{id}/attachments: потоковый приём PNG/JPEG в безымянный
временный файл, SHA-256 на лету, лимиты 10 MiB / 40 Мпикс до чтения
и декодирования, проверка MIME по содержимому, валидация filename.
- Порядок записи pending -> S3 PUT -> ready с компенсацией; janitor
сверяет БД и bucket (dry-run, grace period, advisory lock).
- GET /attachments/{id} и /content только участникам чата, без redirect;
attachment_ids в сообщениях с проверкой принадлежности чату.
- Отдельные S3-ключи api/janitor/admin с ограниченными правами,
идемпотентный bootstrap bucket, служебные порты SeaweedFS закрыты.
- Ограничение параллельных S3 PUT и MALLOC_ARENA_MAX: пик RSS API
178-189 -> 95-102 MiB; лимиты памяти и restart для SeaweedFS после OOM.
- Тесты уровня 4 (негативные, failover вложений, отказы S3/БД, память)
и доказательства в evidence/, заполнен REPORT.md.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# 2026-11-06T22:40:29Z API containers: mounts and temp upload dir after all tests
|
||||
## mtusi-lab4-api-1
|
||||
Mounts: bind:/run/secrets/postgres_password bind:/run/secrets/s3_api_access_key bind:/run/secrets/s3_api_secret_key
|
||||
ls -la /tmp/uploads:
|
||||
total 12
|
||||
drwxrwxrwt 1 root root 4096 Nov 6 22:34 .
|
||||
drwxrwxrwt 1 root root 4096 Nov 6 22:34 ..
|
||||
files > 10 KB anywhere writable (excluding /proc,/sys,/usr,/run/secrets):
|
||||
## mtusi-lab4-api-2
|
||||
Mounts: bind:/run/secrets/postgres_password bind:/run/secrets/s3_api_access_key bind:/run/secrets/s3_api_secret_key
|
||||
ls -la /tmp/uploads:
|
||||
total 12
|
||||
drwxrwxrwt 1 root root 4096 Nov 6 22:34 .
|
||||
drwxrwxrwt 1 root root 4096 Nov 6 22:34 ..
|
||||
files > 10 KB anywhere writable (excluding /proc,/sys,/usr,/run/secrets):
|
||||
## upload buffering: tempfile.TemporaryFile -> O_TMPFILE (no directory entry), deleted on close or process death
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"replicas": [
|
||||
"3256158ccd6a",
|
||||
"680f36c618ba"
|
||||
],
|
||||
"rounds": [
|
||||
{
|
||||
"uploaded_by": "3256158ccd6a",
|
||||
"stopped": "3256158ccd6a",
|
||||
"downloads": [
|
||||
{
|
||||
"instance": "680f36c618ba",
|
||||
"sha256_ok": true,
|
||||
"ms": 8.1
|
||||
},
|
||||
{
|
||||
"instance": "680f36c618ba",
|
||||
"sha256_ok": true,
|
||||
"ms": 8.0
|
||||
},
|
||||
{
|
||||
"instance": "680f36c618ba",
|
||||
"sha256_ok": true,
|
||||
"ms": 7.3
|
||||
},
|
||||
{
|
||||
"instance": "680f36c618ba",
|
||||
"sha256_ok": true,
|
||||
"ms": 20.1
|
||||
},
|
||||
{
|
||||
"instance": "680f36c618ba",
|
||||
"sha256_ok": true,
|
||||
"ms": 7.0
|
||||
}
|
||||
],
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"uploaded_by": "680f36c618ba",
|
||||
"stopped": "680f36c618ba",
|
||||
"downloads": [
|
||||
{
|
||||
"instance": "3256158ccd6a",
|
||||
"sha256_ok": true,
|
||||
"ms": 25.3
|
||||
},
|
||||
{
|
||||
"instance": "3256158ccd6a",
|
||||
"sha256_ok": true,
|
||||
"ms": 9.1
|
||||
},
|
||||
{
|
||||
"instance": "3256158ccd6a",
|
||||
"sha256_ok": true,
|
||||
"ms": 6.2
|
||||
},
|
||||
{
|
||||
"instance": "3256158ccd6a",
|
||||
"sha256_ok": true,
|
||||
"ms": 6.2
|
||||
},
|
||||
{
|
||||
"instance": "3256158ccd6a",
|
||||
"sha256_ok": true,
|
||||
"ms": 5.9
|
||||
}
|
||||
],
|
||||
"pass": true
|
||||
}
|
||||
],
|
||||
"pass": true
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{"uploaded_by": "3256158ccd6a", "stopped": "3256158ccd6a", "downloads": [{"instance": "680f36c618ba", "sha256_ok": true, "ms": 8.1}, {"instance": "680f36c618ba", "sha256_ok": true, "ms": 8.0}, {"instance": "680f36c618ba", "sha256_ok": true, "ms": 7.3}, {"instance": "680f36c618ba", "sha256_ok": true, "ms": 20.1}, {"instance": "680f36c618ba", "sha256_ok": true, "ms": 7.0}], "pass": true}
|
||||
{"uploaded_by": "680f36c618ba", "stopped": "680f36c618ba", "downloads": [{"instance": "3256158ccd6a", "sha256_ok": true, "ms": 25.3}, {"instance": "3256158ccd6a", "sha256_ok": true, "ms": 9.1}, {"instance": "3256158ccd6a", "sha256_ok": true, "ms": 6.2}, {"instance": "3256158ccd6a", "sha256_ok": true, "ms": 6.2}, {"instance": "3256158ccd6a", "sha256_ok": true, "ms": 5.9}], "pass": true}
|
||||
{"pass": true, "rounds": 2}
|
||||
exit=0
|
||||
@@ -0,0 +1,430 @@
|
||||
{
|
||||
"summary": {
|
||||
"cases": 60,
|
||||
"failed": 0,
|
||||
"server_errors_5xx": 0,
|
||||
"pass": true
|
||||
},
|
||||
"results": [
|
||||
{
|
||||
"case": "valid PNG fixture",
|
||||
"expected": 201,
|
||||
"status": 201,
|
||||
"error_code": null,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "valid JPEG",
|
||||
"expected": 201,
|
||||
"status": 201,
|
||||
"error_code": null,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "unicode filename",
|
||||
"expected": 201,
|
||||
"status": 201,
|
||||
"error_code": null,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "PNG near 10 MiB limit (10482871 B)",
|
||||
"expected": 201,
|
||||
"status": 201,
|
||||
"error_code": null,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "too large: 10 MiB + 1 B",
|
||||
"expected": 413,
|
||||
"status": 413,
|
||||
"error_code": "payload_too_large",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "pixel bomb header 100000x100000",
|
||||
"expected": 413,
|
||||
"status": 413,
|
||||
"error_code": "payload_too_large",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "PNG 7000x6000 = 42 Mpx (> 40 Mpx)",
|
||||
"expected": 413,
|
||||
"status": 413,
|
||||
"error_code": "payload_too_large",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "zlib bomb: 100x100 header, 50 MB inflated",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "corrupted PNG (byte flipped, bad CRC)",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "truncated PNG",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "PNG without IEND",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "PNG with appended ZIP (polyglot)",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "truncated JPEG",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "JPEG header only",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "empty body",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "JPEG bytes declared image/png",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "PNG bytes declared image/jpeg",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "text declared image/png",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "GIF declared image/png",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "PNG declared text/html",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "PNG declared image/svg+xml",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "multipart/form-data instead of raw",
|
||||
"expected": 415,
|
||||
"status": 415,
|
||||
"error_code": "unsupported_media_type",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: ../etc/passwd",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: slash",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: backslash",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: NUL",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: newline",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: bidi override U+202E",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: ..",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: empty",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: whitespace only",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: 256 code points",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: missing filename",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: filename twice",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "filename: invalid UTF-8",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "eve uploads to her own chat",
|
||||
"expected": 201,
|
||||
"status": 201,
|
||||
"error_code": null,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "non-member uploads to alice chat",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "upload without session",
|
||||
"expected": 401,
|
||||
"status": 401,
|
||||
"error_code": "unauthorized",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "upload to unknown chat",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "foreign attachment metadata",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "foreign attachment content",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "eve reads alice attachment",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "message with foreign attachment_id",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "message mixing own and foreign ids",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "attachment of OTHER chat of the same user",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "unknown attachment_id",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "malformed attachment_id",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "duplicate attachment_ids",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "11 attachment_ids",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "attachment_ids not a list",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "empty text without attachments",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "empty text with attachment (bob links alice's file)",
|
||||
"expected": 201,
|
||||
"status": 201,
|
||||
"error_code": null,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "idempotent send with attachments",
|
||||
"expected": 201,
|
||||
"status": 201,
|
||||
"error_code": null,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "same key, same body (key order changed)",
|
||||
"expected": 201,
|
||||
"status": 201,
|
||||
"error_code": null,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "same key, different attachment_ids -> 409",
|
||||
"expected": 409,
|
||||
"status": 409,
|
||||
"error_code": "conflict",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "variant=thumbnail (no variants in lab4)",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "variant=bogus",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "variant=original",
|
||||
"expected": 200,
|
||||
"status": 200,
|
||||
"error_code": null,
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "malformed attachment id in path",
|
||||
"expected": 400,
|
||||
"status": 400,
|
||||
"error_code": "invalid_request",
|
||||
"pass": true
|
||||
},
|
||||
{
|
||||
"case": "unknown attachment id",
|
||||
"expected": 404,
|
||||
"status": 404,
|
||||
"error_code": "not_found",
|
||||
"pass": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
PASS valid PNG fixture -> 201
|
||||
PASS valid JPEG -> 201
|
||||
PASS unicode filename -> 201
|
||||
PASS PNG near 10 MiB limit (10482871 B) -> 201
|
||||
PASS too large: 10 MiB + 1 B -> 413 payload_too_large
|
||||
PASS pixel bomb header 100000x100000 -> 413 payload_too_large
|
||||
PASS PNG 7000x6000 = 42 Mpx (> 40 Mpx) -> 413 payload_too_large
|
||||
PASS zlib bomb: 100x100 header, 50 MB inflated -> 415 unsupported_media_type
|
||||
PASS corrupted PNG (byte flipped, bad CRC) -> 415 unsupported_media_type
|
||||
PASS truncated PNG -> 415 unsupported_media_type
|
||||
PASS PNG without IEND -> 415 unsupported_media_type
|
||||
PASS PNG with appended ZIP (polyglot) -> 415 unsupported_media_type
|
||||
PASS truncated JPEG -> 415 unsupported_media_type
|
||||
PASS JPEG header only -> 415 unsupported_media_type
|
||||
PASS empty body -> 415 unsupported_media_type
|
||||
PASS JPEG bytes declared image/png -> 415 unsupported_media_type
|
||||
PASS PNG bytes declared image/jpeg -> 415 unsupported_media_type
|
||||
PASS text declared image/png -> 415 unsupported_media_type
|
||||
PASS GIF declared image/png -> 415 unsupported_media_type
|
||||
PASS PNG declared text/html -> 415 unsupported_media_type
|
||||
PASS PNG declared image/svg+xml -> 415 unsupported_media_type
|
||||
PASS multipart/form-data instead of raw -> 415 unsupported_media_type
|
||||
PASS filename: ../etc/passwd -> 400 invalid_request
|
||||
PASS filename: slash -> 400 invalid_request
|
||||
PASS filename: backslash -> 400 invalid_request
|
||||
PASS filename: NUL -> 400 invalid_request
|
||||
PASS filename: newline -> 400 invalid_request
|
||||
PASS filename: bidi override U+202E -> 400 invalid_request
|
||||
PASS filename: .. -> 400 invalid_request
|
||||
PASS filename: empty -> 400 invalid_request
|
||||
PASS filename: whitespace only -> 400 invalid_request
|
||||
PASS filename: 256 code points -> 400 invalid_request
|
||||
PASS filename: missing filename -> 400 invalid_request
|
||||
PASS filename: filename twice -> 400 invalid_request
|
||||
PASS filename: invalid UTF-8 -> 400 invalid_request
|
||||
PASS eve uploads to her own chat -> 201
|
||||
PASS non-member uploads to alice chat -> 404 not_found
|
||||
PASS upload without session -> 401 unauthorized
|
||||
PASS upload to unknown chat -> 404 not_found
|
||||
PASS foreign attachment metadata -> 404 not_found
|
||||
PASS foreign attachment content -> 404 not_found
|
||||
PASS eve reads alice attachment -> 404 not_found
|
||||
PASS message with foreign attachment_id -> 404 not_found
|
||||
PASS message mixing own and foreign ids -> 404 not_found
|
||||
PASS attachment of OTHER chat of the same user -> 404 not_found
|
||||
PASS unknown attachment_id -> 404 not_found
|
||||
PASS malformed attachment_id -> 400 invalid_request
|
||||
PASS duplicate attachment_ids -> 400 invalid_request
|
||||
PASS 11 attachment_ids -> 400 invalid_request
|
||||
PASS attachment_ids not a list -> 400 invalid_request
|
||||
PASS empty text without attachments -> 400 invalid_request
|
||||
PASS empty text with attachment (bob links alice's file) -> 201
|
||||
PASS idempotent send with attachments -> 201
|
||||
PASS same key, same body (key order changed) -> 201
|
||||
PASS same key, different attachment_ids -> 409 -> 409 conflict
|
||||
PASS variant=thumbnail (no variants in lab4) -> 404 not_found
|
||||
PASS variant=bogus -> 400 invalid_request
|
||||
PASS variant=original -> 200
|
||||
PASS malformed attachment id in path -> 400 invalid_request
|
||||
PASS unknown attachment id -> 404 not_found
|
||||
{"cases": 60, "failed": 0, "server_errors_5xx": 0, "pass": true}
|
||||
@@ -0,0 +1,7 @@
|
||||
# 2026-11-06T22:27:39Z upload_memory.py --concurrency 12 --rounds 3, s3 limit 512M, no GOMEMLIMIT, no restart policy
|
||||
container=/mtusi-lab4-s3-1 OOMKilled=true ExitCode=137 FinishedAt=2026-11-06T22:26:33.807520926Z RestartPolicy=no
|
||||
## api logs at that moment
|
||||
api-2 | 2026-11-06 22:26:33,809 WARNING s3 health: failing (MaxRetryError)
|
||||
api-1 | 2026-11-06 22:26:33,806 WARNING s3 health: failing (MaxRetryError)
|
||||
api-1 | 2026-11-06 22:26:48,084 WARNING s3 health: failing (MaxRetryError)
|
||||
api-2 | 2026-11-06 22:26:48,049 WARNING s3 health: failing (MaxRetryError)
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"concurrency": 12,
|
||||
"rounds": 3,
|
||||
"files": [
|
||||
{
|
||||
"type": "image/png",
|
||||
"bytes": 10482871,
|
||||
"sha256": "a9d76b9ed9660de7"
|
||||
},
|
||||
{
|
||||
"type": "image/jpeg",
|
||||
"bytes": 8051216,
|
||||
"sha256": "c49ef6d9ef42362e"
|
||||
}
|
||||
],
|
||||
"uploads": 36,
|
||||
"status_counts": {
|
||||
"201": 36
|
||||
},
|
||||
"megabytes_uploaded_ok": 318.2,
|
||||
"wall_s": 5.9,
|
||||
"latency_s_p50_max": [
|
||||
1.79,
|
||||
2.1
|
||||
],
|
||||
"replicas": {
|
||||
"0a9e8191e9fe": {
|
||||
"rss_mib": 54,
|
||||
"hwm_mib_after_warmup": 82,
|
||||
"samples": 131,
|
||||
"peak_rss_mib_sampled": 96.0,
|
||||
"peak_anon_mib": 85.1,
|
||||
"peak_file_cache_mib": 55.4,
|
||||
"vmhwm_mib": 96,
|
||||
"cgroup_memory_peak_mib": 145.0,
|
||||
"memory_limit_mib": 256,
|
||||
"uploads_served": 18
|
||||
},
|
||||
"0353e8a0b29e": {
|
||||
"rss_mib": 50,
|
||||
"hwm_mib_after_warmup": 82,
|
||||
"samples": 128,
|
||||
"peak_rss_mib_sampled": 94.8,
|
||||
"peak_anon_mib": 77.7,
|
||||
"peak_file_cache_mib": 53.1,
|
||||
"vmhwm_mib": 94,
|
||||
"cgroup_memory_peak_mib": 124.1,
|
||||
"memory_limit_mib": 256,
|
||||
"uploads_served": 18
|
||||
}
|
||||
},
|
||||
"s3": {
|
||||
"rss_mib": 365,
|
||||
"oom_killed": "false",
|
||||
"peak_rss_mib_sampled": 395.3,
|
||||
"peak_anon_mib": 314.7,
|
||||
"restarts": 0,
|
||||
"oom_killed_after": "false",
|
||||
"memory_limit_mib": 512
|
||||
},
|
||||
"oom_kills": [
|
||||
"false",
|
||||
"false"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"concurrency": 12,
|
||||
"rounds": 3,
|
||||
"files": [
|
||||
{
|
||||
"type": "image/png",
|
||||
"bytes": 10482871,
|
||||
"sha256": "4e9ec1dec161b0bd"
|
||||
},
|
||||
{
|
||||
"type": "image/jpeg",
|
||||
"bytes": 8051216,
|
||||
"sha256": "c49ef6d9ef42362e"
|
||||
}
|
||||
],
|
||||
"uploads": 36,
|
||||
"status_counts": {
|
||||
"201": 36
|
||||
},
|
||||
"megabytes_uploaded_ok": 318.2,
|
||||
"wall_s": 6.2,
|
||||
"latency_s_p50_max": [
|
||||
1.9,
|
||||
2.18
|
||||
],
|
||||
"replicas": {
|
||||
"998f5e4e3c8c": {
|
||||
"rss_mib": 51,
|
||||
"hwm_mib_after_warmup": 82,
|
||||
"samples": 132,
|
||||
"peak_rss_mib_sampled": 178.2,
|
||||
"peak_anon_mib": 160.2,
|
||||
"peak_file_cache_mib": 55.6,
|
||||
"vmhwm_mib": 178,
|
||||
"cgroup_memory_peak_mib": 212.6,
|
||||
"memory_limit_mib": 256,
|
||||
"uploads_served": 18
|
||||
},
|
||||
"7f7d9ec27329": {
|
||||
"rss_mib": 55,
|
||||
"hwm_mib_after_warmup": 83,
|
||||
"samples": 134,
|
||||
"peak_rss_mib_sampled": 189.5,
|
||||
"peak_anon_mib": 171.1,
|
||||
"peak_file_cache_mib": 55.5,
|
||||
"vmhwm_mib": 189,
|
||||
"cgroup_memory_peak_mib": 229.0,
|
||||
"memory_limit_mib": 256,
|
||||
"uploads_served": 18
|
||||
}
|
||||
},
|
||||
"oom_kills": [
|
||||
"false",
|
||||
"false"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"concurrency": 20,
|
||||
"rounds": 3,
|
||||
"files": [
|
||||
{
|
||||
"type": "image/png",
|
||||
"bytes": 10482871,
|
||||
"sha256": "471292d26a5129a1"
|
||||
},
|
||||
{
|
||||
"type": "image/jpeg",
|
||||
"bytes": 8051216,
|
||||
"sha256": "c49ef6d9ef42362e"
|
||||
}
|
||||
],
|
||||
"uploads": 60,
|
||||
"status_counts": {
|
||||
"201": 60
|
||||
},
|
||||
"megabytes_uploaded_ok": 530.3,
|
||||
"wall_s": 9.3,
|
||||
"latency_s_p50_max": [
|
||||
2.42,
|
||||
3.44
|
||||
],
|
||||
"replicas": {
|
||||
"0a9e8191e9fe": {
|
||||
"rss_mib": 50,
|
||||
"hwm_mib_after_warmup": 82,
|
||||
"samples": 181,
|
||||
"peak_rss_mib_sampled": 94.8,
|
||||
"peak_anon_mib": 83.3,
|
||||
"peak_file_cache_mib": 77.7,
|
||||
"vmhwm_mib": 94,
|
||||
"cgroup_memory_peak_mib": 161.0,
|
||||
"memory_limit_mib": 256,
|
||||
"uploads_served": 30
|
||||
},
|
||||
"0353e8a0b29e": {
|
||||
"rss_mib": 54,
|
||||
"hwm_mib_after_warmup": 78,
|
||||
"samples": 174,
|
||||
"peak_rss_mib_sampled": 102.0,
|
||||
"peak_anon_mib": 95.7,
|
||||
"peak_file_cache_mib": 73.0,
|
||||
"vmhwm_mib": 101,
|
||||
"cgroup_memory_peak_mib": 156.7,
|
||||
"memory_limit_mib": 256,
|
||||
"uploads_served": 30
|
||||
}
|
||||
},
|
||||
"s3": {
|
||||
"rss_mib": 373,
|
||||
"oom_killed": "false",
|
||||
"peak_rss_mib_sampled": 442.3,
|
||||
"peak_anon_mib": 362.4,
|
||||
"restarts": 0,
|
||||
"oom_killed_after": "false",
|
||||
"memory_limit_mib": 512
|
||||
},
|
||||
"oom_kills": [
|
||||
"false",
|
||||
"false"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# 2026-11-06T22:31:43Z make check
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
exit=0
|
||||
# 2026-11-06T22:31:43Z docker compose config --quiet
|
||||
exit=0
|
||||
@@ -0,0 +1,209 @@
|
||||
{
|
||||
"pass": true,
|
||||
"steps": [
|
||||
{
|
||||
"step": "baseline janitor dry-run",
|
||||
"t": 1794004683.9,
|
||||
"report": {
|
||||
"dry_run": true,
|
||||
"grace_seconds": 3600,
|
||||
"rows_by_status": {
|
||||
"pending": 15,
|
||||
"ready": 348
|
||||
},
|
||||
"objects_total": 349,
|
||||
"abandoned_pending": 0,
|
||||
"orphan_objects": 0,
|
||||
"missing_objects": 2,
|
||||
"deleted_objects": 0,
|
||||
"deleted_rows": 0,
|
||||
"errors": 0,
|
||||
"duration_ms": 96.7
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "control + victim uploaded (ready)",
|
||||
"t": 1794004684.0,
|
||||
"control": "d9a16769-9f6a-486f-87d5-9d72be773f4f",
|
||||
"victim": "6560be97-8430-4212-b132-e8cc9f7002ec"
|
||||
},
|
||||
{
|
||||
"step": "db-fail-after-s3-put -> compensation",
|
||||
"t": 1794004687.1,
|
||||
"status": 503,
|
||||
"report": {
|
||||
"dry_run": true,
|
||||
"grace_seconds": 3600,
|
||||
"rows_by_status": {
|
||||
"pending": 15,
|
||||
"ready": 350
|
||||
},
|
||||
"objects_total": 351,
|
||||
"abandoned_pending": 0,
|
||||
"orphan_objects": 0,
|
||||
"missing_objects": 2,
|
||||
"deleted_objects": 0,
|
||||
"deleted_rows": 0,
|
||||
"errors": 0,
|
||||
"duration_ms": 92.0
|
||||
},
|
||||
"leftover_pending": 0,
|
||||
"leftover_objects": 0
|
||||
},
|
||||
{
|
||||
"step": "crash-after-s3-put",
|
||||
"t": 1794004687.1,
|
||||
"client_saw": "Failure"
|
||||
},
|
||||
{
|
||||
"step": "crash-after-s3-put",
|
||||
"t": 1794004690.3,
|
||||
"client_saw": "Failure"
|
||||
},
|
||||
{
|
||||
"step": "crash-after-pending",
|
||||
"t": 1794004699.0,
|
||||
"client_saw": "Failure"
|
||||
},
|
||||
{
|
||||
"step": "client aborted upload at 1 of 5 MiB",
|
||||
"t": 1794004707.3,
|
||||
"report": {
|
||||
"dry_run": true,
|
||||
"grace_seconds": 3600,
|
||||
"rows_by_status": {
|
||||
"pending": 18,
|
||||
"ready": 350
|
||||
},
|
||||
"objects_total": 353,
|
||||
"abandoned_pending": 0,
|
||||
"orphan_objects": 0,
|
||||
"missing_objects": 2,
|
||||
"deleted_objects": 0,
|
||||
"deleted_rows": 0,
|
||||
"errors": 0,
|
||||
"duration_ms": 91.8
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "pending rows left by crashes",
|
||||
"t": 1794004707.5,
|
||||
"pending": 3
|
||||
},
|
||||
{
|
||||
"step": "orphan injected: pending row deleted, object kept",
|
||||
"t": 1794004707.6,
|
||||
"row": "cfc406da-7b0a-480d-821e-4fab78251770"
|
||||
},
|
||||
{
|
||||
"step": "missing injected: victim object deleted in S3",
|
||||
"t": 1794004708.3,
|
||||
"download_status": 503
|
||||
},
|
||||
{
|
||||
"step": "janitor grace=3600 (all fresh): dry-run",
|
||||
"t": 1794004714.3,
|
||||
"report": {
|
||||
"dry_run": true,
|
||||
"grace_seconds": 3600,
|
||||
"rows_by_status": {
|
||||
"pending": 17,
|
||||
"ready": 350
|
||||
},
|
||||
"objects_total": 352,
|
||||
"abandoned_pending": 0,
|
||||
"orphan_objects": 0,
|
||||
"missing_objects": 3,
|
||||
"deleted_objects": 0,
|
||||
"deleted_rows": 0,
|
||||
"errors": 0,
|
||||
"duration_ms": 105.7
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "janitor grace=3600 (all fresh): real run deletes nothing",
|
||||
"t": 1794004714.3,
|
||||
"report": {
|
||||
"dry_run": false,
|
||||
"grace_seconds": 3600,
|
||||
"rows_by_status": {
|
||||
"pending": 17,
|
||||
"ready": 350
|
||||
},
|
||||
"objects_total": 352,
|
||||
"abandoned_pending": 0,
|
||||
"orphan_objects": 0,
|
||||
"missing_objects": 3,
|
||||
"deleted_objects": 0,
|
||||
"deleted_rows": 0,
|
||||
"errors": 0,
|
||||
"duration_ms": 99.5
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "after grace: dry-run",
|
||||
"t": 1794004739.4,
|
||||
"report": {
|
||||
"dry_run": true,
|
||||
"grace_seconds": 20,
|
||||
"rows_by_status": {
|
||||
"pending": 17,
|
||||
"ready": 350
|
||||
},
|
||||
"objects_total": 352,
|
||||
"abandoned_pending": 17,
|
||||
"orphan_objects": 1,
|
||||
"missing_objects": 3,
|
||||
"deleted_objects": 0,
|
||||
"deleted_rows": 0,
|
||||
"errors": 0,
|
||||
"duration_ms": 101.9
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "after grace: real run",
|
||||
"t": 1794004742.5,
|
||||
"report": {
|
||||
"dry_run": false,
|
||||
"grace_seconds": 20,
|
||||
"rows_by_status": {
|
||||
"pending": 17,
|
||||
"ready": 350
|
||||
},
|
||||
"objects_total": 348,
|
||||
"abandoned_pending": 17,
|
||||
"orphan_objects": 1,
|
||||
"missing_objects": 3,
|
||||
"deleted_objects": 18,
|
||||
"deleted_rows": 17,
|
||||
"errors": 0,
|
||||
"duration_ms": 103.4
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "after grace: repeated run (idempotent)",
|
||||
"t": 1794004746.0,
|
||||
"report": {
|
||||
"dry_run": false,
|
||||
"grace_seconds": 20,
|
||||
"rows_by_status": {
|
||||
"ready": 350
|
||||
},
|
||||
"objects_total": 347,
|
||||
"abandoned_pending": 0,
|
||||
"orphan_objects": 0,
|
||||
"missing_objects": 3,
|
||||
"deleted_objects": 0,
|
||||
"deleted_rows": 0,
|
||||
"errors": 0,
|
||||
"duration_ms": 99.5
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": "control attachment still intact",
|
||||
"t": 1794004746.1,
|
||||
"sha256_ok": true,
|
||||
"pending_left": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{"step": "baseline janitor dry-run", "t": 1794004683.9, "report": {"dry_run": true, "grace_seconds": 3600, "rows_by_status": {"pending": 15, "ready": 348}, "objects_total": 349, "abandoned_pending": 0, "orphan_objects": 0, "missing_objects": 2, "deleted_objects": 0, "deleted_rows": 0, "errors": 0, "duration_ms": 96.7}}
|
||||
{"step": "control + victim uploaded (ready)", "t": 1794004684.0, "control": "d9a16769-9f6a-486f-87d5-9d72be773f4f", "victim": "6560be97-8430-4212-b132-e8cc9f7002ec"}
|
||||
{"step": "db-fail-after-s3-put -> compensation", "t": 1794004687.1, "status": 503, "report": {"dry_run": true, "grace_seconds": 3600, "rows_by_status": {"pending": 15, "ready": 350}, "objects_total": 351, "abandoned_pending": 0, "orphan_objects": 0, "missing_objects": 2, "deleted_objects": 0, "deleted_rows": 0, "errors": 0, "duration_ms": 92.0}, "leftover_pending": 0, "leftover_objects": 0}
|
||||
{"step": "crash-after-s3-put", "t": 1794004687.1, "client_saw": "Failure"}
|
||||
{"step": "crash-after-s3-put", "t": 1794004690.3, "client_saw": "Failure"}
|
||||
{"step": "crash-after-pending", "t": 1794004699.0, "client_saw": "Failure"}
|
||||
{"step": "client aborted upload at 1 of 5 MiB", "t": 1794004707.3, "report": {"dry_run": true, "grace_seconds": 3600, "rows_by_status": {"pending": 18, "ready": 350}, "objects_total": 353, "abandoned_pending": 0, "orphan_objects": 0, "missing_objects": 2, "deleted_objects": 0, "deleted_rows": 0, "errors": 0, "duration_ms": 91.8}}
|
||||
{"step": "pending rows left by crashes", "t": 1794004707.5, "pending": 3}
|
||||
{"step": "orphan injected: pending row deleted, object kept", "t": 1794004707.6, "row": "cfc406da-7b0a-480d-821e-4fab78251770"}
|
||||
{"step": "missing injected: victim object deleted in S3", "t": 1794004708.3, "download_status": 503}
|
||||
{"step": "janitor grace=3600 (all fresh): dry-run", "t": 1794004714.3, "report": {"dry_run": true, "grace_seconds": 3600, "rows_by_status": {"pending": 17, "ready": 350}, "objects_total": 352, "abandoned_pending": 0, "orphan_objects": 0, "missing_objects": 3, "deleted_objects": 0, "deleted_rows": 0, "errors": 0, "duration_ms": 105.7}}
|
||||
{"step": "janitor grace=3600 (all fresh): real run deletes nothing", "t": 1794004714.3, "report": {"dry_run": false, "grace_seconds": 3600, "rows_by_status": {"pending": 17, "ready": 350}, "objects_total": 352, "abandoned_pending": 0, "orphan_objects": 0, "missing_objects": 3, "deleted_objects": 0, "deleted_rows": 0, "errors": 0, "duration_ms": 99.5}}
|
||||
{"step": "after grace: dry-run", "t": 1794004739.4, "report": {"dry_run": true, "grace_seconds": 20, "rows_by_status": {"pending": 17, "ready": 350}, "objects_total": 352, "abandoned_pending": 17, "orphan_objects": 1, "missing_objects": 3, "deleted_objects": 0, "deleted_rows": 0, "errors": 0, "duration_ms": 101.9}}
|
||||
{"step": "after grace: real run", "t": 1794004742.5, "report": {"dry_run": false, "grace_seconds": 20, "rows_by_status": {"pending": 17, "ready": 350}, "objects_total": 348, "abandoned_pending": 17, "orphan_objects": 1, "missing_objects": 3, "deleted_objects": 18, "deleted_rows": 17, "errors": 0, "duration_ms": 103.4}}
|
||||
{"step": "after grace: repeated run (idempotent)", "t": 1794004746.0, "report": {"dry_run": false, "grace_seconds": 20, "rows_by_status": {"ready": 350}, "objects_total": 347, "abandoned_pending": 0, "orphan_objects": 0, "missing_objects": 3, "deleted_objects": 0, "deleted_rows": 0, "errors": 0, "duration_ms": 99.5}}
|
||||
{"step": "control attachment still intact", "t": 1794004746.1, "sha256_ok": true, "pending_left": 0}
|
||||
{"pass": true}
|
||||
@@ -0,0 +1,16 @@
|
||||
# 2026-11-06T22:36:28Z round 1 make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
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": 128, "failed_attempts": 0, "first_recovery_seconds": 3.616}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
exit=0
|
||||
mtusi-lab4-api-1 Exited (0) 11 seconds ago
|
||||
mtusi-lab4-api-2 Up About a minute (healthy)
|
||||
# 2026-11-06T22:36:53Z round 2 make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
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": 129, "failed_attempts": 0, "first_recovery_seconds": 3.514}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
exit=0
|
||||
mtusi-lab4-api-1 Exited (0) 11 seconds ago
|
||||
mtusi-lab4-api-2 Up 2 minutes (healthy)
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"rounds": 10,
|
||||
"parallel_per_burst": 16,
|
||||
"requests_total": 320,
|
||||
"status_counts": {
|
||||
"same_body": {
|
||||
"201": 160
|
||||
},
|
||||
"conflicting_body": {
|
||||
"201": 80,
|
||||
"409": 80
|
||||
}
|
||||
},
|
||||
"replicas_answered": 2,
|
||||
"requests_per_replica": [
|
||||
80,
|
||||
80
|
||||
],
|
||||
"messages_in_history": 20,
|
||||
"expected_messages": 20,
|
||||
"duplicates": 0,
|
||||
"problems": []
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# 2026-11-06T22:33:44Z cursor_validation
|
||||
PASS: 6 cursor date boundary checks; invalid dates return 400.
|
||||
# 2026-11-06T22:33:44Z idempotency_concurrency --rounds 10 --parallel 16
|
||||
"problems": []
|
||||
}
|
||||
PASS
|
||||
@@ -0,0 +1,19 @@
|
||||
# 2026-11-06T22:34:35Z make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
## before
|
||||
mtusi-lab4-api-1 StartedAt=2026-11-06T22:34:25.142761338Z
|
||||
mtusi-lab4-api-2 StartedAt=2026-11-06T22:34:25.051958422Z
|
||||
mtusi-lab4-db-1 StartedAt=2026-11-06T22:31:48.781439335Z
|
||||
mtusi-lab4-janitor-1 StartedAt=2026-11-06T22:34:25.051487922Z
|
||||
mtusi-lab4-lb-1 StartedAt=2026-11-06T22:34:25.25065088Z
|
||||
mtusi-lab4-s3-1 StartedAt=2026-11-06T22:32:06.180453219Z
|
||||
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.
|
||||
exit=0
|
||||
## after
|
||||
mtusi-lab4-api-1 StartedAt=2026-11-06T22:35:04.992242468Z
|
||||
mtusi-lab4-api-2 StartedAt=2026-11-06T22:35:04.956369718Z
|
||||
mtusi-lab4-db-1 StartedAt=2026-11-06T22:34:36.772295219Z
|
||||
mtusi-lab4-janitor-1 StartedAt=2026-11-06T22:35:11.606706763Z
|
||||
mtusi-lab4-lb-1 StartedAt=2026-11-06T22:35:01.752674342Z
|
||||
mtusi-lab4-s3-1 StartedAt=2026-11-06T22:34:54.170338921Z
|
||||
@@ -0,0 +1,5 @@
|
||||
# 2026-11-06T22:31:45Z s3-init run twice (idempotency)
|
||||
{"bucket": "messenger-attachments", "created": false, "already_existed": true, "anonymous_http_status": {"anonymous_get_object": 403, "anonymous_list_bucket": 403}, "private": true}
|
||||
exit=0
|
||||
{"bucket": "messenger-attachments", "created": false, "already_existed": true, "anonymous_http_status": {"anonymous_get_object": 403, "anonymous_list_bucket": 403}, "private": true}
|
||||
exit=0
|
||||
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"pass": true,
|
||||
"phases": [
|
||||
{
|
||||
"phase": "baseline",
|
||||
"probe": {
|
||||
"upload": {
|
||||
"status": 201,
|
||||
"ms": 8,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
},
|
||||
"download": {
|
||||
"status": 200,
|
||||
"ms": 4,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
},
|
||||
"text_message": {
|
||||
"status": 201,
|
||||
"ms": 5,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
},
|
||||
"ready": {
|
||||
"status": 200,
|
||||
"ms": 1,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"phase": "immediately after `stop s3` (S3Health not yet stale)",
|
||||
"probe": {
|
||||
"upload": {
|
||||
"status": 503,
|
||||
"ms": 14,
|
||||
"code": "unavailable",
|
||||
"retry_after": "1"
|
||||
},
|
||||
"download": {
|
||||
"status": 503,
|
||||
"ms": 11,
|
||||
"code": "unavailable",
|
||||
"retry_after": "1"
|
||||
},
|
||||
"text_message": {
|
||||
"status": 201,
|
||||
"ms": 11,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
},
|
||||
"ready": {
|
||||
"status": 200,
|
||||
"ms": 3,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"phase": "S3 down for 5 s (`stop s3`)",
|
||||
"probe": {
|
||||
"upload": {
|
||||
"status": 503,
|
||||
"ms": 15,
|
||||
"code": "unavailable",
|
||||
"retry_after": "1"
|
||||
},
|
||||
"download": {
|
||||
"status": 503,
|
||||
"ms": 10,
|
||||
"code": "unavailable",
|
||||
"retry_after": "1"
|
||||
},
|
||||
"text_message": {
|
||||
"status": 201,
|
||||
"ms": 8,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
},
|
||||
"ready": {
|
||||
"status": 200,
|
||||
"ms": 3,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"phase": "recovery after `start s3`",
|
||||
"upload_201_after_s": 19.7
|
||||
},
|
||||
{
|
||||
"phase": "immediately after `pause s3` (S3Health not yet stale)",
|
||||
"probe": {
|
||||
"upload": {
|
||||
"status": 503,
|
||||
"ms": 10041,
|
||||
"code": "unavailable",
|
||||
"retry_after": "1"
|
||||
},
|
||||
"download": {
|
||||
"status": 503,
|
||||
"ms": 12,
|
||||
"code": "unavailable",
|
||||
"retry_after": "1"
|
||||
},
|
||||
"text_message": {
|
||||
"status": 201,
|
||||
"ms": 10,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
},
|
||||
"ready": {
|
||||
"status": 200,
|
||||
"ms": 3,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"phase": "S3 down for 5 s (`pause s3`)",
|
||||
"probe": {
|
||||
"upload": {
|
||||
"status": 503,
|
||||
"ms": 15,
|
||||
"code": "unavailable",
|
||||
"retry_after": "1"
|
||||
},
|
||||
"download": {
|
||||
"status": 503,
|
||||
"ms": 10,
|
||||
"code": "unavailable",
|
||||
"retry_after": "1"
|
||||
},
|
||||
"text_message": {
|
||||
"status": 201,
|
||||
"ms": 12,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
},
|
||||
"ready": {
|
||||
"status": 200,
|
||||
"ms": 3,
|
||||
"code": null,
|
||||
"retry_after": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"phase": "recovery after `unpause s3`",
|
||||
"upload_201_after_s": 0.0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{"phase": "baseline", "probe": {"upload": {"status": 201, "ms": 8, "code": null, "retry_after": null}, "download": {"status": 200, "ms": 4, "code": null, "retry_after": null}, "text_message": {"status": 201, "ms": 5, "code": null, "retry_after": null}, "ready": {"status": 200, "ms": 1, "code": null, "retry_after": null}}}
|
||||
{"phase": "immediately after `stop s3` (S3Health not yet stale)", "probe": {"upload": {"status": 503, "ms": 14, "code": "unavailable", "retry_after": "1"}, "download": {"status": 503, "ms": 11, "code": "unavailable", "retry_after": "1"}, "text_message": {"status": 201, "ms": 11, "code": null, "retry_after": null}, "ready": {"status": 200, "ms": 3, "code": null, "retry_after": null}}}
|
||||
{"phase": "S3 down for 5 s (`stop s3`)", "probe": {"upload": {"status": 503, "ms": 15, "code": "unavailable", "retry_after": "1"}, "download": {"status": 503, "ms": 10, "code": "unavailable", "retry_after": "1"}, "text_message": {"status": 201, "ms": 8, "code": null, "retry_after": null}, "ready": {"status": 200, "ms": 3, "code": null, "retry_after": null}}}
|
||||
{"phase": "recovery after `start s3`", "upload_201_after_s": 19.7}
|
||||
{"phase": "immediately after `pause s3` (S3Health not yet stale)", "probe": {"upload": {"status": 503, "ms": 10041, "code": "unavailable", "retry_after": "1"}, "download": {"status": 503, "ms": 12, "code": "unavailable", "retry_after": "1"}, "text_message": {"status": 201, "ms": 10, "code": null, "retry_after": null}, "ready": {"status": 200, "ms": 3, "code": null, "retry_after": null}}}
|
||||
{"phase": "S3 down for 5 s (`pause s3`)", "probe": {"upload": {"status": 503, "ms": 15, "code": "unavailable", "retry_after": "1"}, "download": {"status": 503, "ms": 10, "code": "unavailable", "retry_after": "1"}, "text_message": {"status": 201, "ms": 12, "code": null, "retry_after": null}, "ready": {"status": 200, "ms": 3, "code": null, "retry_after": null}}}
|
||||
{"phase": "recovery after `unpause s3`", "upload_201_after_s": 0.0}
|
||||
{"pass": true, "only_200_201_503": true}
|
||||
@@ -0,0 +1,24 @@
|
||||
# 2026-11-06T22:31:46Z docker compose --profile tools run --rm s3-check
|
||||
PASS api: PutObject в свой bucket expected=allowed got=allowed
|
||||
PASS anonymous GET object expected=403 got=403
|
||||
PASS anonymous ListBucket expected=403 got=403
|
||||
PASS anonymous ListAllMyBuckets expected=403 got=403
|
||||
PASS anonymous PUT object expected=403 got=403
|
||||
PASS api: GetObject expected=allowed got=allowed
|
||||
PASS api: ListBucket expected=denied got=AccessDenied
|
||||
PASS api: CreateBucket expected=denied got=AccessDenied
|
||||
PASS api: DeleteBucket expected=denied got=AccessDenied
|
||||
PASS api: PutBucketPolicy (сделать публичным) expected=denied got=AccessDenied
|
||||
PASS janitor: GetObject (чтение содержимого) expected=denied got=AccessDenied
|
||||
PASS janitor: ListBucket expected=allowed got=allowed
|
||||
PASS janitor: CreateBucket expected=denied got=AccessDenied
|
||||
PASS api: DeleteObject (компенсация) expected=allowed got=allowed
|
||||
PASS port 9333 (master UI/API) из backend-сети expected=closed got=closed
|
||||
PASS port 8080 (volume) из backend-сети expected=closed got=closed
|
||||
PASS port 8888 (filer UI/API) из backend-сети expected=closed got=closed
|
||||
PASS port 8111 (IAM API) из backend-сети expected=closed got=closed
|
||||
PASS port 8181 (Iceberg) из backend-сети expected=closed got=closed
|
||||
PASS port 9101 (Lance) из backend-сети expected=closed got=closed
|
||||
PASS port 8333 (S3 API) из backend-сети expected=open got=open
|
||||
{"checks": 21, "failed": 0}
|
||||
exit=0
|
||||
@@ -0,0 +1,4 @@
|
||||
# 2026-11-06T22:36:27Z make test
|
||||
python3 tests/smoke.py --base-url "http://localhost:8080"
|
||||
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
|
||||
exit=0
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"concurrency": 12,
|
||||
"rounds": 3,
|
||||
"files": [
|
||||
{
|
||||
"type": "image/png",
|
||||
"bytes": 10482871,
|
||||
"sha256": "54d7a3b5e10ad013"
|
||||
},
|
||||
{
|
||||
"type": "image/jpeg",
|
||||
"bytes": 8051216,
|
||||
"sha256": "c49ef6d9ef42362e"
|
||||
}
|
||||
],
|
||||
"uploads": 36,
|
||||
"status_counts": {
|
||||
"201": 36
|
||||
},
|
||||
"megabytes_uploaded_ok": 318.2,
|
||||
"wall_s": 5.4,
|
||||
"latency_s_p50_max": [
|
||||
1.55,
|
||||
1.82
|
||||
],
|
||||
"replicas": {
|
||||
"da654745927f": {
|
||||
"rss_mib": 53,
|
||||
"hwm_mib_after_warmup": 82,
|
||||
"samples": 118,
|
||||
"peak_rss_mib_sampled": 95.7,
|
||||
"peak_anon_mib": 77.1,
|
||||
"peak_file_cache_mib": 55.4,
|
||||
"vmhwm_mib": 95,
|
||||
"cgroup_memory_peak_mib": 134.6,
|
||||
"memory_limit_mib": 256,
|
||||
"uploads_served": 18
|
||||
},
|
||||
"5bc0705ce7a1": {
|
||||
"rss_mib": 50,
|
||||
"hwm_mib_after_warmup": 82,
|
||||
"samples": 119,
|
||||
"peak_rss_mib_sampled": 99.0,
|
||||
"peak_anon_mib": 80.5,
|
||||
"peak_file_cache_mib": 55.4,
|
||||
"vmhwm_mib": 99,
|
||||
"cgroup_memory_peak_mib": 126.8,
|
||||
"memory_limit_mib": 256,
|
||||
"uploads_served": 18
|
||||
}
|
||||
},
|
||||
"s3": {
|
||||
"rss_mib": 458,
|
||||
"oom_killed": "false",
|
||||
"peak_rss_mib_sampled": 483.5,
|
||||
"peak_anon_mib": 403.0,
|
||||
"restarts": 0,
|
||||
"oom_killed_after": "false",
|
||||
"memory_limit_mib": 768
|
||||
},
|
||||
"oom_kills": [
|
||||
"false",
|
||||
"false"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"concurrency": 20,
|
||||
"rounds": 3,
|
||||
"files": [
|
||||
{
|
||||
"type": "image/png",
|
||||
"bytes": 10482871,
|
||||
"sha256": "d54d0141d8a2f357"
|
||||
},
|
||||
{
|
||||
"type": "image/jpeg",
|
||||
"bytes": 8051216,
|
||||
"sha256": "c49ef6d9ef42362e"
|
||||
}
|
||||
],
|
||||
"uploads": 60,
|
||||
"status_counts": {
|
||||
"201": 60
|
||||
},
|
||||
"megabytes_uploaded_ok": 530.3,
|
||||
"wall_s": 8.6,
|
||||
"latency_s_p50_max": [
|
||||
2.4,
|
||||
3.08
|
||||
],
|
||||
"replicas": {
|
||||
"da654745927f": {
|
||||
"rss_mib": 54,
|
||||
"hwm_mib_after_warmup": 82,
|
||||
"samples": 158,
|
||||
"peak_rss_mib_sampled": 97.5,
|
||||
"peak_anon_mib": 79.1,
|
||||
"peak_file_cache_mib": 70.7,
|
||||
"vmhwm_mib": 98,
|
||||
"cgroup_memory_peak_mib": 154.0,
|
||||
"memory_limit_mib": 256,
|
||||
"uploads_served": 30
|
||||
},
|
||||
"5bc0705ce7a1": {
|
||||
"rss_mib": 50,
|
||||
"hwm_mib_after_warmup": 82,
|
||||
"samples": 174,
|
||||
"peak_rss_mib_sampled": 102.1,
|
||||
"peak_anon_mib": 83.6,
|
||||
"peak_file_cache_mib": 75.4,
|
||||
"vmhwm_mib": 102,
|
||||
"cgroup_memory_peak_mib": 168.1,
|
||||
"memory_limit_mib": 256,
|
||||
"uploads_served": 30
|
||||
}
|
||||
},
|
||||
"s3": {
|
||||
"rss_mib": 468,
|
||||
"oom_killed": "false",
|
||||
"peak_rss_mib_sampled": 476.9,
|
||||
"peak_anon_mib": 396.3,
|
||||
"restarts": 0,
|
||||
"oom_killed_after": "false",
|
||||
"memory_limit_mib": 768
|
||||
},
|
||||
"oom_kills": [
|
||||
"false",
|
||||
"false"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user