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:
Vladislav Kunetskiy
2026-10-30 22:36:52 +03:00
parent 6c5ba026f1
commit 4bdcac3dfa
95 changed files with 8466 additions and 764 deletions
+7
View File
@@ -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
+7
View File
@@ -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
1 scenario rep pass detail
2 duplicate_before_effect 1 1 attempts=1
3 stale_version_after_v2 1 1 v1_job=01a18e4a-6bff-7166-a56b-3ee5bc7fad9f
4 duplicate_before_effect 2 1 attempts=1
5 stale_version_after_v2 2 1 v1_job=01a18e4a-9b1b-77ea-8d49-6d14e6b628fe
6 duplicate_before_effect 3 1 attempts=1
7 stale_version_after_v2 3 1 v1_job=01a18e4a-c897-7b9f-83f6-951a71696d39
+21
View File
@@ -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.