Реализация на 5

This commit is contained in:
Grbisba
2026-11-13 11:05:05 +03:00
parent ec540a1a72
commit d862103650
148 changed files with 11225 additions and 55 deletions
+23
View File
@@ -0,0 +1,23 @@
{
"run_id": "79ad73c1e746481385a84cebffdcf65e",
"passed": true,
"checks": [
"contract",
"go_race",
"transaction_rollback",
"smoke",
"private_bucket",
"persistence",
"both_uploaders_failover",
"public_failover",
"s3_down",
"interrupted_body",
"s3_put_db_timeout",
"missing_restore",
"10_client_memory",
"reconciler_grace",
"reconciler_repeat"
],
"remaining_metadata": 167,
"timestamp_utc": "2026-11-13T07:58:31.186189+00:00"
}
+3
View File
@@ -0,0 +1,3 @@
$ ./scripts/bootstrap.sh
Local lab4 settings and synthetic keys ready; existing files preserved.
Local storage credentials ready; existing keys preserved.
+3
View File
@@ -0,0 +1,3 @@
$ ./scripts/bootstrap.sh
Local lab4 settings and synthetic keys ready; existing files preserved.
Local storage credentials ready; existing keys preserved.
+7
View File
@@ -0,0 +1,7 @@
$ ./scripts/compose.sh run --rm -T s3-init
{"bucket_ready":true,"write_checked":true}
Container mtusi2026lab4-evidence-s3-1 Running
Container mtusi2026lab4-evidence-s3-1 Waiting
Container mtusi2026lab4-evidence-s3-1 Healthy
Container mtusi2026lab4-evidence-s3-init-run-4de376c5f6a7 Creating
Container mtusi2026lab4-evidence-s3-init-run-4de376c5f6a7 Created
+6
View File
@@ -0,0 +1,6 @@
$ make check build vet
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
cd service && go build ./...
cd service && go build -o ../bin/benchmark ./cmd/benchmark
cd service && go vet ./...
+1
View File
@@ -0,0 +1 @@
$ ./scripts/compose.sh config --quiet
+23
View File
@@ -0,0 +1,23 @@
{
"run_id": "79ad73c1e746481385a84cebffdcf65e",
"date_utc": "2026-11-13T07:53:45.321916+00:00",
"git_head": "ec540a1a725862a8619fcb758daec4ad197f0dd5",
"working_tree_dirty": true,
"host": "macOS-26.5.1-arm64-arm-64bit-Mach-O",
"docker": {
"ServerVersion": "29.7.2",
"Architecture": "aarch64",
"NCPU": 14,
"MemTotal": 8320954368
},
"project": "mtusi2026lab4-evidence",
"limits": {
"api_replicas": 2,
"api_cpu_each": 1,
"api_ram_each": 536870912,
"upload_timeout": "5s",
"grace": "15s",
"upload_slots_each": 4,
"decode_slots_each": 1
}
}
+4
View File
@@ -0,0 +1,4 @@
$ /Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab4/.venv/bin/python tests/resilience.py --mode failover --action-script scripts/stop-one.sh --base-url http://localhost:18082
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 132, "failed_attempts": 1, "first_recovery_seconds": 0.833}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+210
View File
@@ -0,0 +1,210 @@
{
"private_bucket": {
"anonymous_status": 403,
"api_create_bucket_denied": true
},
"restart": {
"before": [
{
"name": "mtusi2026lab4-evidence-api-1",
"id": "4a021921f561be4bdee675a490989e099b87e444406bea66dba1d9f82001e376",
"started_at": "2026-11-13T07:53:40.063317335Z",
"running": true,
"health": "healthy"
},
{
"name": "mtusi2026lab4-evidence-api-2",
"id": "9b477a3610f71893c9c0dd9d4c4609b6c442852b9ef5d3b1e606669eaf74834c",
"started_at": "2026-11-13T07:53:40.148753501Z",
"running": true,
"health": "healthy"
},
{
"name": "mtusi2026lab4-evidence-lb-1",
"id": "b5cc17b8730977dd413e539913c1d0ceb7ae94af0b951bdf99e85198bc0002e8",
"started_at": "2026-11-13T07:53:40.236674418Z",
"running": true,
"health": "healthy"
},
{
"name": "mtusi2026lab4-evidence-postgres-1",
"id": "e968972d2ba216ff2c712c079027c62e915dec9cf846f0396c5085913ddccf21",
"started_at": "2026-11-13T07:53:07.848785917Z",
"running": true,
"health": "healthy"
},
{
"name": "mtusi2026lab4-evidence-redis-1",
"id": "b300113cef056a81152fe050c653cc69bb33ea3c63eaa8ba687331a030a96b47",
"started_at": "2026-11-13T07:53:07.848210958Z",
"running": true,
"health": "healthy"
},
{
"name": "mtusi2026lab4-evidence-s3-1",
"id": "6ea911e2878fae75ed23e88102a9025bccb25bcc5a8921c3c66d6295db84ae3e",
"started_at": "2026-11-13T07:53:07.853984417Z",
"running": true,
"health": "healthy"
}
],
"after": [
{
"name": "mtusi2026lab4-evidence-api-1",
"id": "ffe0b126d1ef3f136ba1790663bdd510e652d03d12056707257a7994e691b132",
"started_at": "2026-11-13T07:55:08.108779Z",
"running": true,
"health": "healthy"
},
{
"name": "mtusi2026lab4-evidence-api-2",
"id": "ddf8beb720a97155c85335baf4225af10c0e8464c6e82c38022ee41453cde56a",
"started_at": "2026-11-13T07:55:08.180382834Z",
"running": true,
"health": "healthy"
},
{
"name": "mtusi2026lab4-evidence-lb-1",
"id": "b5cc17b8730977dd413e539913c1d0ceb7ae94af0b951bdf99e85198bc0002e8",
"started_at": "2026-11-13T07:55:08.264081834Z",
"running": true,
"health": "healthy"
},
{
"name": "mtusi2026lab4-evidence-postgres-1",
"id": "e968972d2ba216ff2c712c079027c62e915dec9cf846f0396c5085913ddccf21",
"started_at": "2026-11-13T07:54:04.77389293Z",
"running": true,
"health": "healthy"
},
{
"name": "mtusi2026lab4-evidence-redis-1",
"id": "b300113cef056a81152fe050c653cc69bb33ea3c63eaa8ba687331a030a96b47",
"started_at": "2026-11-13T07:54:04.863248305Z",
"running": true,
"health": "healthy"
},
{
"name": "mtusi2026lab4-evidence-s3-1",
"id": "6ea911e2878fae75ed23e88102a9025bccb25bcc5a8921c3c66d6295db84ae3e",
"started_at": "2026-11-13T07:54:29.774768469Z",
"running": true,
"health": "healthy"
}
]
},
"failover": [
{
"stopped_container": "ffe0b126d1ef3f136ba1790663bdd510e652d03d12056707257a7994e691b132",
"upload_instance": "ffe0b126d1ef-37dbaa20-b33b-435f-9096-d7a918f55274",
"download_instance": "ddf8beb720a9-6d79116b-1a2d-435e-80e4-6a59b87714be",
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75"
},
{
"stopped_container": "ddf8beb720a97155c85335baf4225af10c0e8464c6e82c38022ee41453cde56a",
"upload_instance": "ddf8beb720a9-6d79116b-1a2d-435e-80e4-6a59b87714be",
"download_instance": "ffe0b126d1ef-4c4cd939-b319-45c4-81d8-2d9449a97b87",
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75"
}
],
"s3_outage": {
"live": 200,
"ready": 503,
"upload": 503,
"reconciler": {
"apply": true,
"objects": 0,
"metadata": 0,
"orphans": 0,
"fresh_orphans": 0,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 0,
"s3_requests": 1,
"db_checks": 0,
"lock_attempts": 0,
"duration_ms": 9,
"grace_seconds": 15
}
},
"interrupted_upload": {
"metadata_unchanged": true
},
"s3_put_db_timeout": {
"upload_status": 503,
"metadata_unchanged": true
},
"dry_run_after_failed_commit": {
"apply": false,
"objects": 111,
"metadata": 109,
"orphans": 1,
"fresh_orphans": 1,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 109,
"s3_requests": 113,
"db_checks": 113,
"lock_attempts": 219,
"duration_ms": 82,
"grace_seconds": 15
},
"missing_repair": {
"dry_run": {
"apply": false,
"objects": 110,
"metadata": 109,
"orphans": 1,
"fresh_orphans": 1,
"deleted": 0,
"missing": 1,
"marked_missing": 0,
"referenced_objects": 108,
"s3_requests": 113,
"db_checks": 112,
"lock_attempts": 218,
"duration_ms": 86,
"grace_seconds": 15
},
"apply": {
"apply": true,
"objects": 110,
"metadata": 109,
"orphans": 1,
"fresh_orphans": 1,
"deleted": 0,
"missing": 1,
"marked_missing": 1,
"referenced_objects": 108,
"s3_requests": 113,
"db_checks": 113,
"lock_attempts": 218,
"duration_ms": 86,
"grace_seconds": 15
},
"wrong_original_rejected": true,
"restored_sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"reference_preserved": true,
"repeat_safe": true
},
"database_outage": {
"reconciler": {
"apply": true,
"objects": 0,
"metadata": 0,
"orphans": 0,
"fresh_orphans": 0,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 0,
"s3_requests": 0,
"db_checks": 0,
"lock_attempts": 0,
"duration_ms": 30,
"grace_seconds": 15
}
}
}
+87
View File
@@ -0,0 +1,87 @@
$ make test-go BASE_URL=http://localhost:18082
cd service && TEST_BASE_URL="http://localhost:18082" go test -race -count=1 -v ./...
? gitea.privcloud.tech/mtusi2026/cmd/app [no test files]
=== RUN TestLostPostResponseIsNotRetried
--- PASS: TestLostPostResponseIsNotRetried (0.00s)
PASS
ok gitea.privcloud.tech/mtusi2026/cmd/benchmark 2.040s
? gitea.privcloud.tech/mtusi2026/internal/adapter/controller/http [no test files]
? gitea.privcloud.tech/mtusi2026/internal/adapter/repository/cache/outside [no test files]
=== RUN TestIdempotencyTransactionAndExpiry
idempotency_test.go:27: run make test-storage for an isolated PostgreSQL database
--- SKIP: TestIdempotencyTransactionAndExpiry (0.00s)
PASS
ok gitea.privcloud.tech/mtusi2026/internal/adapter/repository/storage 1.453s
? gitea.privcloud.tech/mtusi2026/internal/config [no test files]
? gitea.privcloud.tech/mtusi2026/internal/dto [no test files]
? gitea.privcloud.tech/mtusi2026/internal/gen/contracts [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/apperr [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/auth/jwtprovider [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/cache [no test files]
=== RUN TestSessionFingerprints
--- PASS: TestSessionFingerprints (0.02s)
PASS
ok gitea.privcloud.tech/mtusi2026/internal/pkg/encrypting 2.575s
? gitea.privcloud.tech/mtusi2026/internal/pkg/migrator [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/objectstore [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/postgres [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/postgres/txmanager [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/rest/framework [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/rest/headers [no test files]
=== RUN TestVerifiedSessionIsRequestScoped
2026/11/13 10:53:54 ERROR response error="revoked session" status=401 requestId=bc73f964-1689-40e9-94a6-5921464e0107
--- PASS: TestVerifiedSessionIsRequestScoped (0.00s)
=== RUN TestMissingTokenDoesNotCallSessionStore
2026/11/13 10:53:54 ERROR response error="missing or invalid bearer token" status=401 requestId=3bc04393-afad-4fda-a379-ba4c3b190a72
--- PASS: TestMissingTokenDoesNotCallSessionStore (0.00s)
PASS
ok gitea.privcloud.tech/mtusi2026/internal/pkg/rest/middleware 2.320s
? gitea.privcloud.tech/mtusi2026/internal/pkg/rest/router [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types/authprovider [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types/environment [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types/role [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/validator [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/attachment [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/auth [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/chat [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/user [no test files]
? gitea.privcloud.tech/mtusi2026/migrations [no test files]
=== RUN TestInvalidJSON
=== RUN TestInvalidJSON/malformed
=== RUN TestInvalidJSON/wrong_type
=== RUN TestInvalidJSON/unknown_field
--- PASS: TestInvalidJSON (0.01s)
--- PASS: TestInvalidJSON/malformed (0.01s)
--- PASS: TestInvalidJSON/wrong_type (0.00s)
--- PASS: TestInvalidJSON/unknown_field (0.00s)
=== RUN TestForeignChatIsHidden
--- PASS: TestForeignChatIsHidden (0.55s)
=== RUN TestEmptyMessage
--- PASS: TestEmptyMessage (0.19s)
=== RUN TestDuplicateUsername
--- PASS: TestDuplicateUsername (0.31s)
=== RUN TestMessagePagination
--- PASS: TestMessagePagination (0.23s)
=== RUN TestAttachmentContractAndErrors
=== RUN TestAttachmentContractAndErrors/fake
=== RUN TestAttachmentContractAndErrors/mime_mismatch
=== RUN TestAttachmentContractAndErrors/wrong_type
=== RUN TestAttachmentContractAndErrors/truncated
--- PASS: TestAttachmentContractAndErrors (0.88s)
--- PASS: TestAttachmentContractAndErrors/fake (0.00s)
--- PASS: TestAttachmentContractAndErrors/mime_mismatch (0.00s)
--- PASS: TestAttachmentContractAndErrors/wrong_type (0.00s)
--- PASS: TestAttachmentContractAndErrors/truncated (0.00s)
=== RUN TestConcurrentAttachmentMessage
--- PASS: TestConcurrentAttachmentMessage (0.24s)
=== RUN TestConcurrentMessages
concurrency_test.go:160: 10 clients sent 100 messages; history contains 100 unique messages across 6 pages
--- PASS: TestConcurrentMessages (1.80s)
=== RUN TestIdempotencyContract
--- PASS: TestIdempotencyContract (0.50s)
=== RUN TestConcurrentIdempotencyAcrossReplicas
idempotency_test.go:103: 32 requests across 2 replicas created exactly one message
--- PASS: TestConcurrentIdempotencyAcrossReplicas (0.17s)
PASS
ok gitea.privcloud.tech/mtusi2026/tests 6.628s
+3
View File
@@ -0,0 +1,3 @@
$ /Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab4/.venv/bin/python tests/resilience.py --mode persistence --action-script scripts/restart.sh --base-url http://localhost:18082
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
+8
View File
@@ -0,0 +1,8 @@
$ ./scripts/compose.sh run --rm -T operator storage reconcile --apply
{"apply":true,"objects":0,"metadata":0,"orphans":0,"fresh_orphans":0,"deleted":0,"missing":0,"marked_missing":0,"referenced_objects":0,"s3_requests":0,"db_checks":0,"lock_attempts":0,"duration_ms":30,"grace_seconds":15}
Container mtusi2026lab4-evidence-operator-run-90ffcc11fd1e Creating
Container mtusi2026lab4-evidence-operator-run-90ffcc11fd1e Created
{"time":"2026-11-13T07:56:53.425170091Z","level":"ERROR","msg":"Connect","host":"postgres","port":5432,"database":"messenger","ts":30921958,"err":"failed to connect to `user=messenger database=messenger`: hostname resolving error: lookup postgres on 127.0.0.11:53: no such host"}
{"time":"2026-11-13T07:56:53.425200216Z","level":"ERROR","msg":"Acquire","err":"failed to connect to `user=messenger database=messenger`: hostname resolving error: lookup postgres on 127.0.0.11:53: no such host","ts":30992791}
{"time":"2026-11-13T07:56:53.425281299Z","level":"ERROR","msg":"application stopped","error":"failed to connect to `user=messenger database=messenger`: hostname resolving error: lookup postgres on 127.0.0.11:53: no such host"}
+6
View File
@@ -0,0 +1,6 @@
$ ./scripts/compose.sh run --rm -T operator storage reconcile --apply
{"apply":true,"objects":0,"metadata":0,"orphans":0,"fresh_orphans":0,"deleted":0,"missing":0,"marked_missing":0,"referenced_objects":0,"s3_requests":1,"db_checks":0,"lock_attempts":0,"duration_ms":9,"grace_seconds":15}
Container mtusi2026lab4-evidence-operator-run-c46daade23bf Creating
Container mtusi2026lab4-evidence-operator-run-c46daade23bf Created
{"time":"2026-11-13T07:56:13.911024003Z","level":"ERROR","msg":"application stopped","error":"operation error S3: HeadBucket, https response error StatusCode: 0, RequestID: , HostID: , request send failed, Head \"http://s3:9000/messenger-attachments\": dial tcp: lookup s3 on 127.0.0.11:53: no such host"}
+36
View File
@@ -0,0 +1,36 @@
{
"fresh_apply": {
"apply": true,
"objects": 170,
"metadata": 166,
"orphans": 2,
"fresh_orphans": 2,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 166,
"s3_requests": 171,
"db_checks": 171,
"lock_attempts": 334,
"duration_ms": 120,
"grace_seconds": 3600
},
"fresh_key_preserved": true,
"concurrent_scan": {
"apply": true,
"objects": 171,
"metadata": 167,
"orphans": 2,
"fresh_orphans": 1,
"deleted": 1,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 173,
"db_checks": 173,
"lock_attempts": 336,
"duration_ms": 117,
"grace_seconds": 15
},
"concurrent_upload_sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75"
}
+176
View File
@@ -0,0 +1,176 @@
[
{
"seeded": 100,
"dry_runs": [
{
"apply": false,
"objects": 270,
"metadata": 167,
"orphans": 101,
"fresh_orphans": 0,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 272,
"db_checks": 271,
"lock_attempts": 435,
"duration_ms": 162,
"grace_seconds": 15
},
{
"apply": false,
"objects": 270,
"metadata": 167,
"orphans": 101,
"fresh_orphans": 0,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 272,
"db_checks": 271,
"lock_attempts": 435,
"duration_ms": 153,
"grace_seconds": 15
},
{
"apply": false,
"objects": 270,
"metadata": 167,
"orphans": 101,
"fresh_orphans": 0,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 272,
"db_checks": 271,
"lock_attempts": 435,
"duration_ms": 155,
"grace_seconds": 15
}
],
"apply": {
"apply": true,
"objects": 270,
"metadata": 167,
"orphans": 101,
"fresh_orphans": 0,
"deleted": 101,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 373,
"db_checks": 372,
"lock_attempts": 435,
"duration_ms": 209,
"grace_seconds": 15
},
"repeat_apply": {
"apply": true,
"objects": 169,
"metadata": 167,
"orphans": 0,
"fresh_orphans": 0,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 170,
"db_checks": 170,
"lock_attempts": 334,
"duration_ms": 112,
"grace_seconds": 15
},
"invalid_key_preserved": true,
"outside_prefix_preserved": true
},
{
"seeded": 1000,
"dry_runs": [
{
"apply": false,
"objects": 1169,
"metadata": 167,
"orphans": 1000,
"fresh_orphans": 0,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 1180,
"db_checks": 1170,
"lock_attempts": 1334,
"duration_ms": 573,
"grace_seconds": 15
},
{
"apply": false,
"objects": 1169,
"metadata": 167,
"orphans": 1000,
"fresh_orphans": 0,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 1180,
"db_checks": 1170,
"lock_attempts": 1334,
"duration_ms": 555,
"grace_seconds": 15
},
{
"apply": false,
"objects": 1169,
"metadata": 167,
"orphans": 1000,
"fresh_orphans": 0,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 1180,
"db_checks": 1170,
"lock_attempts": 1334,
"duration_ms": 551,
"grace_seconds": 15
}
],
"apply": {
"apply": true,
"objects": 1169,
"metadata": 167,
"orphans": 1000,
"fresh_orphans": 0,
"deleted": 1000,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 2180,
"db_checks": 2170,
"lock_attempts": 1334,
"duration_ms": 952,
"grace_seconds": 15
},
"repeat_apply": {
"apply": true,
"objects": 169,
"metadata": 167,
"orphans": 0,
"fresh_orphans": 0,
"deleted": 0,
"missing": 0,
"marked_missing": 0,
"referenced_objects": 167,
"s3_requests": 170,
"db_checks": 170,
"lock_attempts": 334,
"duration_ms": 119,
"grace_seconds": 15
},
"invalid_key_preserved": true,
"outside_prefix_preserved": true
}
]
+3
View File
@@ -0,0 +1,3 @@
$ make test BASE_URL=http://localhost:18082
python3 tests/smoke.py --base-url "http://localhost:18082"
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
+37
View File
@@ -0,0 +1,37 @@
$ ./scripts/compose.sh down
Container mtusi2026lab4-evidence-lb-1 Stopping
Container mtusi2026lab4-evidence-redis-1 Stopping
Container mtusi2026lab4-evidence-lb-1 Stopped
Container mtusi2026lab4-evidence-lb-1 Removing
Container mtusi2026lab4-evidence-lb-1 Removed
Container mtusi2026lab4-evidence-api-2 Stopping
Container mtusi2026lab4-evidence-api-1 Stopping
Container mtusi2026lab4-evidence-redis-1 Stopped
Container mtusi2026lab4-evidence-redis-1 Removing
Container mtusi2026lab4-evidence-redis-1 Removed
Container mtusi2026lab4-evidence-api-1 Stopped
Container mtusi2026lab4-evidence-api-1 Removing
Container mtusi2026lab4-evidence-api-1 Removed
Container mtusi2026lab4-evidence-api-2 Stopped
Container mtusi2026lab4-evidence-api-2 Removing
Container mtusi2026lab4-evidence-api-2 Removed
Container mtusi2026lab4-evidence-migrate-1 Stopping
Container mtusi2026lab4-evidence-s3-init-1 Stopping
Container mtusi2026lab4-evidence-migrate-1 Stopped
Container mtusi2026lab4-evidence-s3-init-1 Stopped
Container mtusi2026lab4-evidence-s3-init-1 Removing
Container mtusi2026lab4-evidence-migrate-1 Removing
Container mtusi2026lab4-evidence-s3-init-1 Removed
Container mtusi2026lab4-evidence-s3-1 Stopping
Container mtusi2026lab4-evidence-migrate-1 Removed
Container mtusi2026lab4-evidence-postgres-1 Stopping
Container mtusi2026lab4-evidence-postgres-1 Stopped
Container mtusi2026lab4-evidence-postgres-1 Removing
Container mtusi2026lab4-evidence-postgres-1 Removed
Container mtusi2026lab4-evidence-s3-1 Stopped
Container mtusi2026lab4-evidence-s3-1 Removing
Container mtusi2026lab4-evidence-s3-1 Removed
Network mtusi2026lab4-evidence_storage Removing
Network mtusi2026lab4-evidence_default Removing
Network mtusi2026lab4-evidence_default Removed
Network mtusi2026lab4-evidence_storage Removed
+172
View File
@@ -0,0 +1,172 @@
$ ./scripts/compose.sh up -d --build --wait --wait-timeout 120
#1 [internal] load local bake definitions
#1 reading from stdin 1.68kB done
#1 DONE 0.0s
#2 [api internal] load build definition from Dockerfile
#2 transferring dockerfile: 944B done
#2 DONE 0.0s
#3 [s3-init] resolve image config for docker-image://docker.io/docker/dockerfile:1
#3 DONE 3.6s
#4 [s3-init] docker-image://docker.io/docker/dockerfile:1@sha256:4edf897a3ffa55b89f906fc8cc78afdb3f1834cc9c7083565e611a8a7d5fe99e
#4 resolve docker.io/docker/dockerfile:1@sha256:4edf897a3ffa55b89f906fc8cc78afdb3f1834cc9c7083565e611a8a7d5fe99e done
#4 CACHED
#5 [s3-init internal] load metadata for docker.io/library/alpine:3.23.6@sha256:85fe1e81d6758c208f3e1eed4338a1997e19d4be002d4dd32d3100c9a8c010a0
#5 DONE 0.7s
#6 [api internal] load metadata for docker.io/library/golang:1.27.2-alpine3.23@sha256:9e45f0eb4a63ed37ad6e604950407558b7c738e34e015ae77a5d4ad369cde079
#6 DONE 0.7s
#7 [migrate internal] load .dockerignore
#7 transferring context: 196B done
#7 DONE 0.0s
#8 [s3-init build 1/6] FROM docker.io/library/golang:1.27.2-alpine3.23@sha256:9e45f0eb4a63ed37ad6e604950407558b7c738e34e015ae77a5d4ad369cde079
#8 resolve docker.io/library/golang:1.27.2-alpine3.23@sha256:9e45f0eb4a63ed37ad6e604950407558b7c738e34e015ae77a5d4ad369cde079 done
#8 DONE 0.0s
#9 [api stage-1 1/2] FROM docker.io/library/alpine:3.23.6@sha256:85fe1e81d6758c208f3e1eed4338a1997e19d4be002d4dd32d3100c9a8c010a0
#9 resolve docker.io/library/alpine:3.23.6@sha256:85fe1e81d6758c208f3e1eed4338a1997e19d4be002d4dd32d3100c9a8c010a0 done
#9 DONE 0.0s
#10 [s3-init internal] load build context
#10 transferring context: 266.10kB 0.0s done
#10 transferring context: 266.10kB 0.0s done
#10 DONE 0.0s
#11 [migrate build 2/6] WORKDIR /src
#11 CACHED
#12 [migrate build 3/6] COPY service/go.mod service/go.sum ./
#12 CACHED
#13 [migrate build 4/6] RUN go mod download
#13 CACHED
#14 [migrate build 5/6] COPY service/ ./
#14 DONE 0.0s
#15 [api build 6/6] RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -mod=readonly -trimpath -ldflags="-s -w" -o /out/messenger ./cmd/app
#15 DONE 7.8s
#9 [api stage-1 1/2] FROM docker.io/library/alpine:3.23.6@sha256:85fe1e81d6758c208f3e1eed4338a1997e19d4be002d4dd32d3100c9a8c010a0
#9 CACHED
#16 [migrate stage-1 2/2] COPY --from=build --chmod=0555 /out/messenger /usr/local/bin/messenger
#16 DONE 0.0s
#17 [migrate] exporting to image
#17 exporting layers
#17 exporting layers 0.5s done
#17 exporting manifest sha256:948ad1af6f992219f7dde5f8603ccbe4d82f65f7411590734325f8ece4054d56 done
#17 exporting config sha256:b5651d81abddc31715bf9ebe20720b9ae976dfe1bcf2230fe726ae4b64efbd2b done
#17 exporting attestation manifest sha256:74933fc7013ee1ad77249c9075e39d1e7a64ea7cf4dc6ce30859e988dbbb60a7 done
#17 exporting manifest list sha256:20e4a53b5326121835451e2a95f1b04fdf1254e45e39143c098943ec98819735 done
#17 naming to docker.io/library/mtusi-messenger:lab4 done
#17 unpacking to docker.io/library/mtusi-messenger:lab4
#17 unpacking to docker.io/library/mtusi-messenger:lab4 0.1s done
#17 DONE 0.6s
#18 [s3-init] exporting to image
#18 exporting layers 0.5s done
#18 exporting manifest sha256:1b344fe5d9c17d81bb90b013ac68d8ce1ac45b8e408e3f0c7b0d8d8e8928a88c done
#18 exporting config sha256:09f51d8271d61bcdf3b2770077dcb7b186790f7aa2c318a33ab4b910a1ddb321 done
#18 exporting attestation manifest sha256:cdc25996773907cddbcfad92c53bd16c96eca4a73039bac0b87dade8bbff7ee5 done
#18 exporting manifest list sha256:e1f8984d98f03ef74ee13c081c7cb133a44cf6d52f7c40b574de43d7f229231c done
#18 naming to docker.io/library/mtusi-messenger:lab4 done
#18 unpacking to docker.io/library/mtusi-messenger:lab4 0.1s done
#18 DONE 0.6s
#19 [api] exporting to image
#19 exporting layers 0.5s done
#19 exporting manifest sha256:76240d7f6b0a289ed497879e1b42846dfa453a01922e70d74e9359f36bb726ed done
#19 exporting config sha256:4c6f1c5da51ee7ebebdf68baa35acda1a67837791a3329906b594c466747809f done
#19 exporting attestation manifest sha256:76d4cf96e9b2b523f6a5839249e6a0a9d0d19cee7dfd7b1b6369d4f7da114c32 done
#19 exporting manifest list sha256:dcf1f3e6a116f95109ebe249de73d7d9969523b2fabadfa26f6d9d834a33d8aa done
#19 naming to docker.io/library/mtusi-messenger:lab4 done
#19 unpacking to docker.io/library/mtusi-messenger:lab4 0.1s done
#19 DONE 0.6s
#20 [api] resolving provenance for metadata file
#20 DONE 0.0s
#21 [s3-init] resolving provenance for metadata file
#21 DONE 0.0s
#22 [migrate] resolving provenance for metadata file
#22 DONE 0.0s
Image postgres:17.11-alpine3.23@sha256:05aa77262db9277fde6374bb2f901c9604b8a9373029e1a7993440c6aae48736 Pulling
Image haproxy:3.2-alpine@sha256:96ec3c75a9264ba94e733eeacb44051ed6e7b79bb77a73c2c36f236b6423f1f0 Pulling
Image redis:8.2.11-alpine3.22@sha256:489a769e0a54dc245896132a15c72d2bc7296719954da99398f43a3877e5f8eb Pulling
Image postgres:17.11-alpine3.23@sha256:05aa77262db9277fde6374bb2f901c9604b8a9373029e1a7993440c6aae48736 Pulled
Image redis:8.2.11-alpine3.22@sha256:489a769e0a54dc245896132a15c72d2bc7296719954da99398f43a3877e5f8eb Pulled
Image haproxy:3.2-alpine@sha256:96ec3c75a9264ba94e733eeacb44051ed6e7b79bb77a73c2c36f236b6423f1f0 Pulled
Image mtusi-messenger:lab4 Building
Image mtusi-messenger:lab4 Building
Image mtusi-messenger:lab4 Building
Image mtusi-messenger:lab4 Built
Image mtusi-messenger:lab4 Built
Image mtusi-messenger:lab4 Built
Network mtusi2026lab4-evidence_storage Creating
Network mtusi2026lab4-evidence_storage Created
Network mtusi2026lab4-evidence_default Creating
Network mtusi2026lab4-evidence_default Created
Container mtusi2026lab4-evidence-redis-1 Creating
Container mtusi2026lab4-evidence-postgres-1 Creating
Container mtusi2026lab4-evidence-s3-1 Creating
Container mtusi2026lab4-evidence-postgres-1 Created
Container mtusi2026lab4-evidence-redis-1 Created
Container mtusi2026lab4-evidence-migrate-1 Creating
Container mtusi2026lab4-evidence-s3-1 Created
Container mtusi2026lab4-evidence-s3-init-1 Creating
Container mtusi2026lab4-evidence-s3-init-1 Created
Container mtusi2026lab4-evidence-migrate-1 Created
Container mtusi2026lab4-evidence-api-1 Creating
Container mtusi2026lab4-evidence-api-2 Creating
Container mtusi2026lab4-evidence-api-2 Created
Container mtusi2026lab4-evidence-lb-1 Creating
Container mtusi2026lab4-evidence-api-1 Created
Container mtusi2026lab4-evidence-lb-1 Created
Container mtusi2026lab4-evidence-redis-1 Starting
Container mtusi2026lab4-evidence-s3-1 Starting
Container mtusi2026lab4-evidence-postgres-1 Starting
Container mtusi2026lab4-evidence-redis-1 Started
Container mtusi2026lab4-evidence-s3-1 Started
Container mtusi2026lab4-evidence-s3-1 Waiting
Container mtusi2026lab4-evidence-postgres-1 Started
Container mtusi2026lab4-evidence-postgres-1 Waiting
Container mtusi2026lab4-evidence-s3-1 Healthy
Container mtusi2026lab4-evidence-s3-init-1 Starting
Container mtusi2026lab4-evidence-postgres-1 Healthy
Container mtusi2026lab4-evidence-migrate-1 Starting
Container mtusi2026lab4-evidence-migrate-1 Started
Container mtusi2026lab4-evidence-s3-init-1 Started
Container mtusi2026lab4-evidence-s3-init-1 Waiting
Container mtusi2026lab4-evidence-migrate-1 Waiting
Container mtusi2026lab4-evidence-migrate-1 Exited
Container mtusi2026lab4-evidence-s3-init-1 Exited
Container mtusi2026lab4-evidence-api-1 Starting
Container mtusi2026lab4-evidence-api-1 Started
Container mtusi2026lab4-evidence-api-2 Starting
Container mtusi2026lab4-evidence-api-2 Started
Container mtusi2026lab4-evidence-lb-1 Starting
Container mtusi2026lab4-evidence-lb-1 Started
Container mtusi2026lab4-evidence-postgres-1 Waiting
Container mtusi2026lab4-evidence-redis-1 Waiting
Container mtusi2026lab4-evidence-migrate-1 Waiting
Container mtusi2026lab4-evidence-lb-1 Waiting
Container mtusi2026lab4-evidence-api-1 Waiting
Container mtusi2026lab4-evidence-api-2 Waiting
Container mtusi2026lab4-evidence-s3-init-1 Waiting
Container mtusi2026lab4-evidence-s3-1 Waiting
Container mtusi2026lab4-evidence-migrate-1 Exited
Container mtusi2026lab4-evidence-s3-init-1 Exited
Container mtusi2026lab4-evidence-s3-1 Healthy
Container mtusi2026lab4-evidence-postgres-1 Healthy
Container mtusi2026lab4-evidence-redis-1 Healthy
Container mtusi2026lab4-evidence-lb-1 Healthy
Container mtusi2026lab4-evidence-api-1 Healthy
Container mtusi2026lab4-evidence-api-2 Healthy
+113
View File
@@ -0,0 +1,113 @@
$ make test-storage
./scripts/test-storage.sh
=== RUN TestIdempotencyTransactionAndExpiry
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/empty
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/whitespace
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/invalid_UTF8
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/nul
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/too_long
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/duplicate
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/too_many
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/nil_id
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/unknown
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/foreign_chat
=== RUN TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/missing_object
=== RUN TestIdempotencyTransactionAndExpiry/object_lock_cancellation_does_not_leak_a_pooled_lock
=== NAME TestIdempotencyTransactionAndExpiry
idempotency_test.go:295: rollback removed both side effect and key; expired key created one new message
--- PASS: TestIdempotencyTransactionAndExpiry (0.11s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules (0.02s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/empty (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/whitespace (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/invalid_UTF8 (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/nul (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/too_long (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/duplicate (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/too_many (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/nil_id (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/unknown (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/foreign_chat (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/service_owns_message_content_rules/missing_object (0.00s)
--- PASS: TestIdempotencyTransactionAndExpiry/object_lock_cancellation_does_not_leak_a_pooled_lock (0.05s)
PASS
2026/11/13 07:54:01 INFO connected to database db=lab4_atomic_1794556440_46549
2026/11/13 07:54:01 INFO successfully initialized migrator
2026/11/13 07:54:01 INFO successfully loaded migrations error=<nil>
2026/11/13 07:54:01 INFO postgres_pool_config max_conns=8 connect_timeout=500ms statement_timeout_ms=2000
2026/11/13 07:54:01 INFO successfully connected to postgres pool
2026/11/13 07:54:01 ERROR Query err="ERROR: synthetic failure (SQLSTATE P0001)" ts=187.375µs pid=244 sql="INSERT INTO message_idempotency(user_id,method,chat_id,key,request_hash,message_id,expires_at,hash_version)\n VALUES($1,'POST',$2,$3,$4,$5,clock_timestamp()+interval '24 hours',2)\n ON CONFLICT(user_id,method,chat_id,key) DO UPDATE SET request_hash=EXCLUDED.request_hash,\n message_id=EXCLUDED.message_id,expires_at=EXCLUDED.expires_at,hash_version=EXCLUDED.hash_version" args="[a6a209a3-9450-4393-ab7a-0c2859360754 877fa02a-7912-436c-83d1-9f0bc9cc0552 failure-key da0166d9297a757bea3229f89135b665155b9cf24402c98ce373c6388e9d0e1e 8ec1c403-6820-4c60-a2df-3fcbc2095228]"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 WARN chat_cache_read_error chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552 error="cache disabled for storage test"
2026/11/13 07:54:01 INFO chat_db_lookup chat_id=877fa02a-7912-436c-83d1-9f0bc9cc0552
2026/11/13 07:54:01 ERROR Query err="ERROR: insert or update on table \"message_attachments\" violates foreign key constraint \"message_attachments_attachment_id_chat_id_fkey\" (SQLSTATE 23503)" ts=127.375µs pid=244 sql="INSERT INTO message_attachments(message_id,chat_id,attachment_id,position) VALUES($1,$2,$3,$4)" args="[4ee5dcc7-106c-4641-b38e-06d84880cf1e 877fa02a-7912-436c-83d1-9f0bc9cc0552 7bd482b6-cd37-4061-93c0-7859e2869d25 1]"
2026/11/13 07:54:01 ERROR Query sql="SELECT pg_advisory_lock(hashtextextended($1, 42))" args=[originals/bcaecf31-d3db-4b63-8eb3-6c93cea1c0b5] err="timeout: context deadline exceeded" ts=49.253584ms pid=245
+242
View File
@@ -0,0 +1,242 @@
[
{
"bytes": 111817,
"trial": 1,
"clients": 10,
"warmup_uploads": 1,
"duration_seconds": 0.045627042185515165,
"successful": 10,
"errors": 0,
"error_rate": 0.0,
"successful_rps": 219.16827216940695,
"p50": 0.02541474997997284,
"p95": 0.028515249956399202,
"p99": 0.028515249956399202,
"status_counts": {
"201": 10,
"429": 0
},
"memory": [
{
"container": "479285b815728028100c778d05babe85b3421168a85f9e9df93d69581016af4a",
"memory_current_bytes": 13234176,
"memory_peak_bytes": 13832192
},
{
"container": "f444514998d92002c13af6d661d836a9fca8c0c0897e1f8178f392f331330021",
"memory_current_bytes": 12759040,
"memory_peak_bytes": 13574144
}
],
"cpu": [
{
"container": "mtusi2026lab4-evidence-api-1",
"cpu_percent": "0.25%"
},
{
"container": "mtusi2026lab4-evidence-api-2",
"cpu_percent": "2.55%"
}
]
},
{
"bytes": 111817,
"trial": 2,
"clients": 10,
"warmup_uploads": 1,
"duration_seconds": 0.029648167081177235,
"successful": 9,
"errors": 1,
"error_rate": 0.1,
"successful_rps": 303.5600809776143,
"p50": 0.014442541170865297,
"p95": 0.01693266723304987,
"p99": 0.01693266723304987,
"status_counts": {
"201": 9,
"429": 1
},
"memory": [
{
"container": "766c4aef25644649737f64d33e5df0792acdcdbde755f842a3dfbf0e0bc8d7a1",
"memory_current_bytes": 12324864,
"memory_peak_bytes": 13078528
},
{
"container": "eb4099b7c393d646e33daa515aed5c70830cc2d7160b4aa47e14397a4b77b08f",
"memory_current_bytes": 12996608,
"memory_peak_bytes": 13590528
}
],
"cpu": [
{
"container": "mtusi2026lab4-evidence-api-1",
"cpu_percent": "0.13%"
},
{
"container": "mtusi2026lab4-evidence-api-2",
"cpu_percent": "0.13%"
}
]
},
{
"bytes": 111817,
"trial": 3,
"clients": 10,
"warmup_uploads": 1,
"duration_seconds": 0.02836104203015566,
"successful": 8,
"errors": 2,
"error_rate": 0.2,
"successful_rps": 282.077082763524,
"p50": 0.01445808308199048,
"p95": 0.016181250102818012,
"p99": 0.016181250102818012,
"status_counts": {
"201": 8,
"429": 2
},
"memory": [
{
"container": "4a08738b0bf7d79af7b748f93daf080a6785ef2c3544b0adcab6babad2b98250",
"memory_current_bytes": 12472320,
"memory_peak_bytes": 13578240
},
{
"container": "2638f057e37683bb69ca2dd0186c48b850b59f49cb7ad996cc54f692cfd8dec0",
"memory_current_bytes": 12480512,
"memory_peak_bytes": 15990784
}
],
"cpu": [
{
"container": "mtusi2026lab4-evidence-api-1",
"cpu_percent": "0.13%"
},
{
"container": "mtusi2026lab4-evidence-api-2",
"cpu_percent": "0.14%"
}
]
},
{
"bytes": 5242880,
"trial": 1,
"clients": 10,
"warmup_uploads": 1,
"duration_seconds": 0.5475144158117473,
"successful": 8,
"errors": 2,
"error_rate": 0.2,
"successful_rps": 14.611487422005435,
"p50": 0.34232541639357805,
"p95": 0.4190103751607239,
"p99": 0.4190103751607239,
"status_counts": {
"201": 8,
"429": 2
},
"memory": [
{
"container": "664f6dfcafa5a0e7a2214d767bf12751b4608ef0ee118f7880a76a57224d22e2",
"memory_current_bytes": 12546048,
"memory_peak_bytes": 36929536
},
{
"container": "66031c7c8e3e485219b19559e8633bda3861ad246e82bae4e47a59c87c6fb8e6",
"memory_current_bytes": 12845056,
"memory_peak_bytes": 36102144
}
],
"cpu": [
{
"container": "mtusi2026lab4-evidence-api-1",
"cpu_percent": "0.10%"
},
{
"container": "mtusi2026lab4-evidence-api-2",
"cpu_percent": "8.72%"
}
]
},
{
"bytes": 5242880,
"trial": 2,
"clients": 10,
"warmup_uploads": 1,
"duration_seconds": 0.5503349169157445,
"successful": 8,
"errors": 2,
"error_rate": 0.2,
"successful_rps": 14.536602628876604,
"p50": 0.2895928327925503,
"p95": 0.3782998751848936,
"p99": 0.3782998751848936,
"status_counts": {
"201": 8,
"429": 2
},
"memory": [
{
"container": "cce4850d2fa0564dea54b6b5a1e8197d376019934260aa871c82b442f83d7690",
"memory_current_bytes": 12611584,
"memory_peak_bytes": 36061184
},
{
"container": "01766d6a85e6156b645c500303479cfaf7d373901a8b7c1559df35ca4362cdfc",
"memory_current_bytes": 12718080,
"memory_peak_bytes": 35934208
}
],
"cpu": [
{
"container": "mtusi2026lab4-evidence-api-1",
"cpu_percent": "0.09%"
},
{
"container": "mtusi2026lab4-evidence-api-2",
"cpu_percent": "8.52%"
}
]
},
{
"bytes": 5242880,
"trial": 3,
"clients": 10,
"warmup_uploads": 1,
"duration_seconds": 0.5343151250854135,
"successful": 8,
"errors": 2,
"error_rate": 0.2,
"successful_rps": 14.972437845028535,
"p50": 0.29230537498369813,
"p95": 0.3612105417996645,
"p99": 0.3612105417996645,
"status_counts": {
"201": 8,
"429": 2
},
"memory": [
{
"container": "bd0efe3d0c1c9e25a4dd507e11cd39eea552da4cc7288c3baefb89e6b2e90979",
"memory_current_bytes": 12541952,
"memory_peak_bytes": 37253120
},
{
"container": "73970c1453db19ecf2b51ed020b1f9db82c460927f11ff2711b4627527203a3f",
"memory_current_bytes": 12967936,
"memory_peak_bytes": 37167104
}
],
"cpu": [
{
"container": "mtusi2026lab4-evidence-api-1",
"cpu_percent": "0.14%"
},
{
"container": "mtusi2026lab4-evidence-api-2",
"cpu_percent": "8.36%"
}
]
}
]
+3
View File
@@ -0,0 +1,3 @@
$ make validate PYTHON=/Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab4/.venv/bin/python
/Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab4/.venv/bin/python scripts/validate_openapi.py
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.