lab5: асинхронная очередь, worker и идемпотентный pipeline
API принимает 202 после durable staging и TX intent (job+outbox); отдельные relay и worker публикуют/обрабатывают задания с publisher confirm, lease, retry/backoff, DLQ и replay. Добавлены версии pipeline, варианты thumbnail/crop/optimized, presign в verified staging, status-aware sweeper и admission control.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Lab5 evidence
|
||||
|
||||
All artifacts were produced against the local Compose stand on 2026-10-30
|
||||
(2 vCPU, 2 GiB Docker VM, RabbitMQ 4.3.7, PostgreSQL 18, SeaweedFS 3.80).
|
||||
|
||||
- `stand.txt` — containers, image versions, VM limits.
|
||||
- `smoke.txt` — public `make test`.
|
||||
- `async.txt` — worker down/restart, broker restart with volume, stack restart.
|
||||
- `variants.txt` — thumbnail/crop/optimized metadata, bytes, dimensions.
|
||||
- `faults.txt` — permanent/transient retry, DLQ/replay, crash before/after
|
||||
side effect, crash before/after ack, outbox gap, lease takeover.
|
||||
- `persistence.txt`, `failover.txt`, `idempotency.txt`, `lb-readiness.txt` —
|
||||
cumulative lab2–lab4 regressions.
|
||||
- `track2/run.txt`, `track2/runs.csv`, `track2/summary.md` — track 2
|
||||
duplicate/stale/version harness (3 repetitions).
|
||||
- `unit-test.txt`, `integration-test.txt`, `vet.txt`, `lint.txt`,
|
||||
`validate.txt` — build/quality gates.
|
||||
|
||||
No `.env`, tokens, credentials or presigned URLs are stored here. Raw SQL rows
|
||||
contain only synthetic IDs and metadata.
|
||||
@@ -0,0 +1,7 @@
|
||||
# lab5_async 2026-10-30T19:29:41Z
|
||||
worker down: 202 queued, content 409, queued attachment linked
|
||||
worker restarted: ready, thumbnail and original downloadable, staging cleared
|
||||
broker down: upload accepted into outbox
|
||||
broker + relay recovered: queued job reached ready
|
||||
stack restart: ready attachment and original preserved
|
||||
PASS: lab5 async worker/broker durability
|
||||
@@ -0,0 +1,15 @@
|
||||
# attachments negative 2026-10-30T19:32:35Z
|
||||
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 python3 student-tests/attachments_negative.py --base-url "http://localhost:8080"
|
||||
10 MiB + 1 body: 413
|
||||
empty body: 415
|
||||
corrupt PNG (IDAT CRC): 415
|
||||
MIME spoof (PNG declared as JPEG): 415
|
||||
dangerous filenames: 400
|
||||
foreign attachment metadata/content: 404
|
||||
empty text without attachments: 400
|
||||
attachment from another chat: 404
|
||||
11 attachment ids: 400
|
||||
duplicate attachment ids: 400
|
||||
attachment-only message: 201
|
||||
anonymous direct S3 GET: 403
|
||||
PASS: lab4 attachment negative scenarios
|
||||
@@ -0,0 +1,29 @@
|
||||
# db state 2026-10-30T19:34:38Z
|
||||
status | count
|
||||
---------+-------
|
||||
failed | 8
|
||||
pending | 4
|
||||
ready | 74
|
||||
(3 rows)
|
||||
|
||||
status | count
|
||||
--------+-------
|
||||
failed | 8
|
||||
ready | 81
|
||||
(2 rows)
|
||||
|
||||
variants
|
||||
----------
|
||||
243
|
||||
(1 row)
|
||||
|
||||
unpublished | outbox
|
||||
-------------+--------
|
||||
0 | 150
|
||||
(1 row)
|
||||
|
||||
Timeout: 60.0 seconds ...
|
||||
Listing queues for vhost messenger ...
|
||||
name messages messages_ready messages_unacknowledged consumers
|
||||
attachment.process.dead 12 12 0 0
|
||||
attachment.process.v1 0 0 0 1
|
||||
@@ -0,0 +1,5 @@
|
||||
# failover 2026-10-30T19:32:39Z
|
||||
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 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": 98, "failed_attempts": 0, "first_recovery_seconds": 2.34}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,11 @@
|
||||
# fault injection 2026-10-30T19:30:35Z
|
||||
permanent failure: failed/injected_failure, content 409, failed attachment not linkable, registry visible
|
||||
replay: failed -> queued -> ready, one thumbnail
|
||||
replay ready job: refused
|
||||
transient exhaustion: attempts=5, retry_exhausted, four retries, DLQ message present
|
||||
crash after first variant: redelivered, same three variants, attempts=2
|
||||
crash after commit before ack: ready remains, redelivery is a no-op
|
||||
crash after claim before side effect: requeued, attempts=2, ready
|
||||
outbox gap: crash before publish recovered through the relay, outbox published, ready
|
||||
lease expiry: paused worker, reaper requeued, stale attempt fenced, ready
|
||||
PASS: lab5 level 4 fault injection
|
||||
@@ -0,0 +1,4 @@
|
||||
# idempotency 2026-10-30T19:32:39Z
|
||||
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 python3 student-tests/idempotency_parallel.py --base-url "http://localhost:8080"
|
||||
{"replay": {"workers": 12, "instances": ["5012b453c822", "63bc0da849d5"], "message_id": "01a18e4c-cb55-7c5f-a0e3-f3285329e15b"}, "conflict": {"workers": 12, "accepted": 1, "conflicts": 11}, "stable_body": {"message_id": "01a18e4c-cb87-70be-889e-b4b781fc7d0f"}, "key_required": {"status": 400}}
|
||||
PASS: параллельный повтор с одним Idempotency-Key создаёт ровно одно сообщение
|
||||
@@ -0,0 +1,2 @@
|
||||
ok mtusi-messenger/internal/storage/postgres 8.124s
|
||||
ok mtusi-messenger/internal/storage/redis 1.122s
|
||||
@@ -0,0 +1,31 @@
|
||||
# LB excludes a not-ready but reachable replica (lab5)
|
||||
# generated: 2026-10-30T19:20:42Z
|
||||
# lb: haproxy:3.2-alpine
|
||||
|
||||
## 1. baseline: requests through LB by replica
|
||||
16 803d72737a58
|
||||
24 d6715be2c42f
|
||||
stats: api1=UP api2=UP api3=MAINT (resolution) api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
|
||||
## 2. start a temporary TCP proxy to postgres and a candidate replica behind the same network alias
|
||||
instance-id: 515cb33ab1b9, readiness while its database is reachable: 200
|
||||
load balancer slot for the candidate: api3, stats: api1=UP api2=UP api3=UP api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
|
||||
## 3. cut the candidate's database access (stop only the TCP proxy)
|
||||
candidate is still running: running, readiness: 503
|
||||
waiting for the load balancer to mark api3 DOWN
|
||||
api3 went DOWN 3s after its database was cut (check: inter 2s fall 2)
|
||||
stats after failure: api1=UP api2=UP api3=DOWN api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
|
||||
## 4. 40 requests through LB while the candidate is not ready
|
||||
19 803d72737a58
|
||||
21 d6715be2c42f
|
||||
(the candidate must not appear above)
|
||||
|
||||
## 5. business writes through LB during the exclusion
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 919.321,
|
||||
|
||||
## 6. cleanup
|
||||
stats after cleanup: api1=UP api2=UP api3=MAINT (resolution) api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
@@ -0,0 +1,34 @@
|
||||
# lb readiness 2026-10-30T19:33:46Z
|
||||
scripts/lb_readiness_check.sh
|
||||
# LB excludes a not-ready but reachable replica (lab5)
|
||||
# generated: 2026-10-30T19:33:46Z
|
||||
# lb: haproxy:3.2-alpine
|
||||
|
||||
## 1. baseline: requests through LB by replica
|
||||
23 5012b453c822
|
||||
17 63bc0da849d5
|
||||
stats: api1=UP 1/2 api2=UP api3=MAINT (resolution) api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
|
||||
## 2. start a temporary TCP proxy to postgres and a candidate replica behind the same network alias
|
||||
instance-id: 4da30d29f490, readiness while its database is reachable: 200
|
||||
load balancer slot for the candidate: api1, stats: api1=UP api2=UP api3=UP api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
|
||||
## 3. cut the candidate's database access (stop only the TCP proxy)
|
||||
candidate is still running: running, readiness: 503
|
||||
waiting for the load balancer to mark api1 DOWN
|
||||
WARNING: api1 is still not DOWN
|
||||
stats after failure: api1=UP api2=UP api3=DOWN api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
|
||||
## 4. 40 requests through LB while the candidate is not ready
|
||||
18 5012b453c822
|
||||
22 63bc0da849d5
|
||||
(the candidate must not appear above)
|
||||
|
||||
## 5. business writes through LB during the exclusion
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 810.163,
|
||||
|
||||
## 6. cleanup
|
||||
stats after cleanup: api1=UP api2=UP api3=MAINT (resolution) api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
lb_readiness_check.sh: evidence in evidence/lb-readiness.txt
|
||||
@@ -0,0 +1,20 @@
|
||||
/Users/vladislav/Projects/mtusi2026lab5/bin/golangci-lint run -v
|
||||
level=info msg="golangci-lint has version 2.13.2 built with go1.27.1 from (unknown, modified: ?, mod sum: \"h1:bCyq3E4vo9qwzifjpzJqYndEt7Ncva80qkk8G2B4TXU=\") on (unknown)"
|
||||
level=info msg="[config_reader] Config search paths: [./ /Users/vladislav/Projects/mtusi2026lab5 /Users/vladislav/Projects /Users/vladislav /Users /]"
|
||||
level=info msg="[config_reader] Used config file .golangci.yml"
|
||||
level=info msg="[config_reader] Module name \"mtusi-messenger\""
|
||||
level=info msg="[goenv] Read go env for 5.612667ms: map[string]string{\"GOCACHE\":\"/Users/vladislav/Library/Caches/go-build\", \"GOROOT\":\"/opt/homebrew/Cellar/go/1.27.1/libexec\"}"
|
||||
level=info msg="[lintersdb] Active 50 linters: [asasalint bodyclose canonicalheader containedctx contextcheck copyloopvar depguard durationcheck errcheck errname errorlint exhaustive exptostd fatcontext forbidigo forcetypeassert gocheckcompilerdirectives gocritic gofumpt goimports gomoddirectives gosec govet ineffassign intrange makezero misspell musttag nilerr nilnil noctx nolintlint perfsprint prealloc reassign recvcheck revive rowserrcheck sloglint sqlclosecheck staticcheck testifylint thelper tparallel unconvert unparam unused usestdlibvars usetesting wastedassign]"
|
||||
level=info msg="[loader] Using build tags: [integration]"
|
||||
level=info msg="[loader] Go packages loading at mode 8767 (compiled_files|deps|exports_file|imports|name|types_sizes|files) took 241.235292ms"
|
||||
level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 11.528667ms"
|
||||
level=info msg="[linters_context/goanalysis] analyzers took 2.426723836s with top 10 stages: revive: 891.424584ms, goimports: 197.31775ms, gosec: 134.79375ms, wastedassign: 101.139582ms, ctrlflow: 56.356778ms, gocritic: 43.448751ms, unparam: 40.089709ms, sloglint: 32.727792ms, ineffassign: 32.149583ms, directives: 31.348126ms"
|
||||
level=info msg="[runner/exclusion_rules] Skipped 7 issues by rules: [Path: \"_test\\\\.go\", Linters: \"gosec, prealloc, forcetypeassert, unparam\"]"
|
||||
level=info msg="[runner] Issues before processing: 889, after processing: 0"
|
||||
level=info msg="[runner] Processors filtering stat (in/out): path_absoluter: 889/889, nolint_filter: 6/0, filename_unadjuster: 889/889, invalid_issue: 889/889, exclusion_rules: 302/6, cgo: 889/889, exclusion_paths: 889/889, generated_file_filter: 889/302, path_relativity: 889/889"
|
||||
level=info msg="[runner] processing took 3.421128ms with stages: generated_file_filter: 2.333667ms, nolint_filter: 532.749µs, path_relativity: 260.5µs, exclusion_rules: 259.916µs, invalid_issue: 12.625µs, cgo: 12.125µs, path_absoluter: 5.042µs, filename_unadjuster: 2.626µs, sort_results: 500ns, max_same_issues: 250ns, exclusion_paths: 209ns, fixer: 167ns, path_prettifier: 167ns, path_shortener: 126ns, source_code: 125ns, max_per_file_from_linter: 125ns, diff: 84ns, max_from_linter: 42ns, severity-rules: 42ns, uniq_by_line: 41ns"
|
||||
level=info msg="[runner] linters took 1.269085s with stages: goanalysis_metalinter: 1.265620125s"
|
||||
0 issues.
|
||||
level=info msg="File cache stats: 0 entries of total size 0B"
|
||||
level=info msg="Memory: 17 samples, avg is 140.2MB, max is 244.9MB"
|
||||
level=info msg="Execution took 1.52797275s"
|
||||
@@ -0,0 +1,4 @@
|
||||
# persistence 2026-10-30T19:33:01Z
|
||||
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 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.
|
||||
@@ -0,0 +1,11 @@
|
||||
# presign 2026-10-30T19:32:37Z
|
||||
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 python3 student-tests/presign_flow.py --base-url "http://localhost:8080"
|
||||
happy path: direct PUT 200, complete queued, ready after worker
|
||||
message with attachment downloaded as the second chat member
|
||||
repeated complete is idempotent
|
||||
foreign complete: 404
|
||||
complete before PUT: 409
|
||||
wrong completion checksum: 409
|
||||
oversized direct PUT: 403 from S3; complete: 409 (nothing stored)
|
||||
same-size overwrite: last PUT wins, checksum verified
|
||||
PASS: lab4 presigned upload flow
|
||||
@@ -0,0 +1,3 @@
|
||||
# make test 2026-10-30T19:29:39Z
|
||||
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 python3 tests/smoke.py --base-url "http://localhost:8080"
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,20 @@
|
||||
# stand 2026-10-30T19:34:37Z
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
mtusi-messenger-lab5-api-1 mtusi-messenger:lab5 "/usr/local/bin/mess…" api 5 minutes ago Up 58 seconds (healthy) 8080/tcp
|
||||
mtusi-messenger-lab5-api-2 mtusi-messenger:lab5 "/usr/local/bin/mess…" api 5 minutes ago Up 58 seconds (healthy) 8080/tcp
|
||||
mtusi-messenger-lab5-broker-1 rabbitmq:4.3.7-management-alpine "docker-entrypoint.s…" broker 47 minutes ago Up About a minute (healthy) 4369/tcp, 5671-5672/tcp, 15671/tcp, 15691-15692/tcp, 25672/tcp, 127.0.0.1:15672->15672/tcp
|
||||
mtusi-messenger-lab5-lb-1 haproxy:3.2-alpine "docker-entrypoint.s…" lb 47 minutes ago Up 53 seconds 127.0.0.1:8404->8404/tcp, 127.0.0.1:8080->80/tcp
|
||||
mtusi-messenger-lab5-postgres-1 postgres:18-alpine@sha256:77f585114c32fbca283dc835b0596f4e52b51b4c6662d7810b2f4084f60a1873 "docker-entrypoint.s…" postgres 7 minutes ago Up About a minute (healthy) 5432/tcp
|
||||
mtusi-messenger-lab5-redis-1 redis:7.4-alpine "docker-entrypoint.s…" redis 47 minutes ago Up About a minute (healthy) 6379/tcp
|
||||
mtusi-messenger-lab5-relay-1 mtusi-messenger:lab5 "/usr/local/bin/relay" relay 2 minutes ago Up 58 seconds (healthy) 8080/tcp, 127.0.0.1:8082->8082/tcp
|
||||
mtusi-messenger-lab5-seaweedfs-1 chrislusf/seaweedfs:3.80@sha256:1055999e08eed1789b0ae45d235126e4495e23d3fb9d6396293fd42539b1ae6a "/entrypoint.sh serv…" seaweedfs 46 minutes ago Up About a minute (healthy) 7333/tcp, 8080/tcp, 8888/tcp, 9333/tcp, 18080/tcp, 18888/tcp, 19333/tcp, 127.0.0.1:8333->8333/tcp
|
||||
mtusi-messenger-lab5-worker-1 mtusi-messenger:lab5 "/usr/local/bin/work…" worker 2 minutes ago Up 58 seconds (healthy) 8080/tcp, 127.0.0.1:8081->8081/tcp
|
||||
|
||||
mtusi-messenger:lab5 bc5f51c66c24
|
||||
rabbitmq:4.3.7-management-alpine 1528a88eebf2
|
||||
haproxy:3.2-alpine 254e6370f01c
|
||||
redis:7.4-alpine 858f009f9709
|
||||
postgres:18-alpine 77f585114c32
|
||||
chrislusf/seaweedfs:3.80 1055999e08ee
|
||||
|
||||
CPUs=2 MemTotal=2053644288
|
||||
@@ -0,0 +1,7 @@
|
||||
Dduplicate_before_effect rep=1: PASS
|
||||
Dstale_version_after_v2 rep=1: PASS
|
||||
Dduplicate_before_effect rep=2: PASS
|
||||
Dstale_version_after_v2 rep=2: PASS
|
||||
Dduplicate_before_effect rep=3: PASS
|
||||
Dstale_version_after_v2 rep=3: PASS
|
||||
PASS: track2 6/6 scenarios
|
||||
@@ -0,0 +1,7 @@
|
||||
scenario,rep,pass,detail
|
||||
duplicate_before_effect,1,1,attempts=1
|
||||
stale_version_after_v2,1,1,v1_job=01a18e4a-6bff-7166-a56b-3ee5bc7fad9f
|
||||
duplicate_before_effect,2,1,attempts=1
|
||||
stale_version_after_v2,2,1,v1_job=01a18e4a-9b1b-77ea-8d49-6d14e6b628fe
|
||||
duplicate_before_effect,3,1,attempts=1
|
||||
stale_version_after_v2,3,1,v1_job=01a18e4a-c897-7b9f-83f6-951a71696d39
|
||||
|
@@ -0,0 +1,21 @@
|
||||
# Track 2 — versioned pipeline and duplicate/stale delivery
|
||||
|
||||
Hypothesis: with the effect key `(attachment_id, pipeline_version, variant)`,
|
||||
deterministic object keys, a serving version that changes only when all v2
|
||||
variants are committed, and stale-version acknowledgements, an at-least-once
|
||||
pipeline loses no accepted work and never overwrites a newer result with an
|
||||
older duplicate.
|
||||
|
||||
Method: N=3 repetitions. Each repetition creates fresh users/chat and runs:
|
||||
- duplicate pipeline publication while the worker is stopped, followed by recovery;
|
||||
- v1 ready -> explicit reprocess to v2 -> old v1 message delivered after v2 ready.
|
||||
|
||||
Invariants checked: unique variant rows per effect key; ready remains ready;
|
||||
serving pipeline version never regresses; original bytes/checksum unchanged;
|
||||
stale job state is not rewritten.
|
||||
|
||||
Limitations: this harness covers duplicate and stale/reorder delivery. Crash
|
||||
windows (before/after side effect, before/after ack, outbox gap) and lease
|
||||
takeover are covered by student-tests/lab5_faults.py; both are single-node
|
||||
Compose evidence, not a production availability claim. Delivery is
|
||||
at-least-once; exactly-once is not claimed.
|
||||
@@ -0,0 +1,41 @@
|
||||
env -u APP_ENV -u SERVER_HOST -u SERVER_PORT -u SERVER_READ_HEADER_TIMEOUT -u SERVER_READ_TIMEOUT -u SERVER_SHUTDOWN_TIMEOUT -u SERVER_MAX_BODY_BYTES -u LOG_LEVEL -u LOG_FORMAT -u POSTGRES_HOST -u POSTGRES_PORT -u POSTGRES_DATABASE -u POSTGRES_USER -u POSTGRES_PASSWORD -u POSTGRES_SSL_MODE -u POSTGRES_MAX_CONNS -u POSTGRES_MIN_CONNS -u POSTGRES_MAX_CONN_LIFETIME -u POSTGRES_MAX_CONN_IDLE_TIME -u POSTGRES_CONNECT_TIMEOUT -u POSTGRES_QUERY_TIMEOUT -u REDIS_ENABLED -u REDIS_HOST -u REDIS_PORT -u REDIS_PASSWORD -u REDIS_DB -u REDIS_MAX_RETRIES -u REDIS_DIAL_TIMEOUT -u REDIS_READ_TIMEOUT -u REDIS_WRITE_TIMEOUT -u REDIS_POOL_SIZE -u CACHE_ENABLED -u CACHE_CHAT_LIST_TTL -u CACHE_LOCK_TTL -u CACHE_LOCK_WAIT_TIMEOUT -u SESSION_TTL_SECONDS -u IDEMPOTENCY_TTL_SECONDS -u API_REPLICAS -u API_CPU_LIMIT -u API_MEM_LIMIT -u POSTGRES_MAX_CONNS -u POSTGRES_CPU_LIMIT -u POSTGRES_MEM_LIMIT -u LB_STATS_PORT -u S3_ENDPOINT -u S3_PUBLIC_ENDPOINT -u S3_PORT -u S3_REGION -u S3_BUCKET -u S3_ACCESS_KEY_ID -u S3_SECRET_ACCESS_KEY -u MAX_UPLOAD_BYTES -u MAX_IMAGE_PIXELS -u S3_PRESIGN_TTL -u S3_SWEEP_INTERVAL -u S3_SWEEP_GRACE -u BROKER_USER -u BROKER_PASSWORD -u BROKER_VHOST -u BROKER_URL -u BROKER_EXCHANGE -u BROKER_QUEUE -u BROKER_DLX -u BROKER_DLQ -u BROKER_MANAGEMENT_PORT -u BROKER_CPU_LIMIT -u BROKER_MEM_LIMIT -u WORKER_CONCURRENCY -u WORKER_PREFETCH -u WORKER_CPU_LIMIT -u WORKER_MEM_LIMIT -u WORKER_SHUTDOWN_TIMEOUT -u PROCESSING_PIPELINE_VERSION -u PROCESSING_MAX_ATTEMPTS -u PROCESSING_JOB_TIMEOUT -u PROCESSING_LEASE_TTL -u PROCESSING_HEARTBEAT -u PROCESSING_RETRY_BASE -u PROCESSING_RETRY_CAP -u OUTBOX_POLL_INTERVAL -u OUTBOX_CLAIM_TTL -u OUTBOX_BATCH -u OUTBOX_REAPER_INTERVAL -u OUTBOX_RETENTION -u RELAY_CPU_LIMIT -u RELAY_MEM_LIMIT -u STAGING_ORPHAN_GRACE -u STAGING_FAILED_RETENTION -u ADMISSION_MAX_PENDING_PER_USER -u ADMISSION_MAX_PENDING -u ADMISSION_MAX_STAGED_BYTES go test -race -shuffle=on -count=1 -timeout=5m ./...
|
||||
? mtusi-messenger/cmd/jobctl [no test files]
|
||||
? mtusi-messenger/cmd/messenger [no test files]
|
||||
? mtusi-messenger/cmd/migrate [no test files]
|
||||
? mtusi-messenger/cmd/relay [no test files]
|
||||
? mtusi-messenger/cmd/s3init [no test files]
|
||||
? mtusi-messenger/cmd/worker [no test files]
|
||||
? mtusi-messenger/internal/broker [no test files]
|
||||
ok mtusi-messenger/internal/config 1.470s
|
||||
ok mtusi-messenger/internal/domain 1.621s
|
||||
? mtusi-messenger/internal/failpoint [no test files]
|
||||
ok mtusi-messenger/internal/health 2.890s
|
||||
ok mtusi-messenger/internal/imagecheck 2.373s
|
||||
ok mtusi-messenger/internal/imageproc 2.240s
|
||||
ok mtusi-messenger/internal/logger 3.288s
|
||||
? mtusi-messenger/internal/outbox [no test files]
|
||||
ok mtusi-messenger/internal/platform/cache 3.207s
|
||||
? mtusi-messenger/internal/platform/cache/mocks [no test files]
|
||||
ok mtusi-messenger/internal/platform/objectstore 3.773s
|
||||
ok mtusi-messenger/internal/platform/password 2.523s
|
||||
ok mtusi-messenger/internal/platform/token 2.532s
|
||||
ok mtusi-messenger/internal/service/attachment 2.729s
|
||||
? mtusi-messenger/internal/service/attachment/mocks [no test files]
|
||||
ok mtusi-messenger/internal/service/chat 2.019s
|
||||
? mtusi-messenger/internal/service/chat/mocks [no test files]
|
||||
ok mtusi-messenger/internal/service/message 3.609s
|
||||
? mtusi-messenger/internal/service/message/mocks [no test files]
|
||||
ok mtusi-messenger/internal/service/session 4.238s
|
||||
? mtusi-messenger/internal/service/session/mocks [no test files]
|
||||
ok mtusi-messenger/internal/service/user 1.365s
|
||||
? mtusi-messenger/internal/service/user/mocks [no test files]
|
||||
ok mtusi-messenger/internal/storage/postgres 4.021s
|
||||
? mtusi-messenger/internal/storage/postgres/internal/sqlcgen [no test files]
|
||||
? mtusi-messenger/internal/storage/postgres/migrations [no test files]
|
||||
? mtusi-messenger/internal/storage/redis [no test files]
|
||||
? mtusi-messenger/internal/storage/redis/mocks [no test files]
|
||||
ok mtusi-messenger/internal/transport/rest 4.311s
|
||||
? mtusi-messenger/internal/transport/rest/internal/oas [no test files]
|
||||
? mtusi-messenger/internal/transport/rest/mocks [no test files]
|
||||
? mtusi-messenger/internal/worker [no test files]
|
||||
? mtusi-messenger/tools/specgen [no test files]
|
||||
@@ -0,0 +1 @@
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
@@ -0,0 +1,3 @@
|
||||
# lab5_variants 2026-10-30T19:29:54Z
|
||||
variants: thumbnail 256x160, crop 128x128, optimized WebP 320x200; metadata == bytes
|
||||
PASS: lab5 variant contract
|
||||
+14
-14
@@ -1,31 +1,31 @@
|
||||
# LB excludes a not-ready but reachable replica (lab3)
|
||||
# generated: 2026-10-16T14:02:26Z
|
||||
# LB excludes a not-ready but reachable replica (lab5)
|
||||
# generated: 2026-10-30T19:33:46Z
|
||||
# lb: haproxy:3.2-alpine
|
||||
|
||||
## 1. baseline: requests through LB by replica
|
||||
18 52861386fddb
|
||||
22 8587b4251b72
|
||||
stats: api1=UP api2=UP api3=MAINT (resolution) api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
23 5012b453c822
|
||||
17 63bc0da849d5
|
||||
stats: api1=UP 1/2 api2=UP api3=MAINT (resolution) api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
|
||||
## 2. start a temporary TCP proxy to postgres and a candidate replica behind the same network alias
|
||||
instance-id: 9e9e905440d3, readiness while its database is reachable: 200
|
||||
load balancer slot for the candidate: api3, stats: api1=UP api2=UP api3=UP api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
instance-id: 4da30d29f490, readiness while its database is reachable: 200
|
||||
load balancer slot for the candidate: api1, stats: api1=UP api2=UP api3=UP api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
|
||||
## 3. cut the candidate's database access (stop only the TCP proxy)
|
||||
candidate is still running: running, readiness: 503
|
||||
waiting for the load balancer to mark api3 DOWN
|
||||
api3 went DOWN 2s after its database was cut (check: inter 2s fall 2)
|
||||
stats after failure: api1=UP api2=UP api3=DOWN api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
waiting for the load balancer to mark api1 DOWN
|
||||
WARNING: api1 is still not DOWN
|
||||
stats after failure: api1=UP api2=UP api3=DOWN api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
|
||||
## 4. 40 requests through LB while the candidate is not ready
|
||||
18 52861386fddb
|
||||
22 8587b4251b72
|
||||
18 5012b453c822
|
||||
22 63bc0da849d5
|
||||
(the candidate must not appear above)
|
||||
|
||||
## 5. business writes through LB during the exclusion
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 1163.529,
|
||||
"successful_rps": 810.163,
|
||||
|
||||
## 6. cleanup
|
||||
stats after cleanup: api1=UP api2=UP api3=MAINT (resolution) api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
stats after cleanup: api1=UP api2=UP api3=MAINT (resolution) api4=MAINT (resolution) api5=MAINT (resolution) api6=MAINT (resolution) api7=MAINT (resolution) api8=MAINT (resolution) BACKEND=UP
|
||||
|
||||
Reference in New Issue
Block a user