forked from mtusi2026/mtusi2026lab5
lab5: RabbitMQ, relay и worker в стенде; reconciler lab4 убран
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> broker: RabbitMQ 4.3.7 (тег+digest), quorum queue + DLX/DLQ из definitions, пользователи relay (только publish в exchange) и worker (только consume), без management UI и портов. relay: outbox -> publish с publisher confirm, reaper истёкших lease, страховка от потерянных сообщений. worker: claim + heartbeat lease, варианты, публикация с fencing, ack после COMMIT, graceful stop, уборка staging и мусора попыток. S3: два bucket и четыре identity (admin, api, worker, auditor) с проверкой модели доступа в s3-init. Отдельная сеть queue. Reconciler lab4 (трек прошлой лабы) удалён: его роль выполняет уборка по журналу попыток.
This commit is contained in:
+12
-9
@@ -1,18 +1,21 @@
|
||||
#!/bin/sh
|
||||
# Restart hook for `make test-persistence ACTION_SCRIPT=scripts/restart.sh`.
|
||||
# Restarts EVERY process of the stand: LB, all API replicas, PostgreSQL, Valkey and S3 (SeaweedFS).
|
||||
# Volumes, schema and data are preserved: no `down -v`, no FLUSH, no re-seed.
|
||||
# Restarts EVERY process of the stand: LB, all API replicas, relay, worker(s), PostgreSQL, Valkey,
|
||||
# S3 (SeaweedFS) and the broker (RabbitMQ). Volumes, schema, data and queued messages are
|
||||
# preserved: no `down -v`, no FLUSH, no purge, no re-seed.
|
||||
# Output is suppressed by the test; run it by hand to see the steps.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# 1. Entry point and API first: no request is served while the stores restart underneath.
|
||||
docker compose stop lb api
|
||||
# 1. Entry point, API and the pipeline processes first: nothing is served or processed while the
|
||||
# stores restart underneath.
|
||||
docker compose stop lb api relay worker
|
||||
# 2. Stores: clean shutdown (PostgreSQL checkpoint, Valkey AOF fsync, SeaweedFS volume/filer
|
||||
# flush), then start again. The S3 bytes live on the named volume s3data.
|
||||
docker compose restart postgres valkey s3
|
||||
# 3. API replicas (wait for healthy stores via depends_on), then the LB. HAProxy resolves
|
||||
# the new replica addresses through Docker DNS by itself - no stale backend list.
|
||||
# flush, RabbitMQ quorum log), then start again. Bytes live on s3data, messages on rabbitmqdata.
|
||||
docker compose restart postgres valkey s3 broker
|
||||
# 3. API replicas (wait for healthy stores via depends_on), the LB, then relay and worker. HAProxy
|
||||
# resolves the new replica addresses through Docker DNS by itself - no stale backend list.
|
||||
docker compose start api
|
||||
docker compose start lb
|
||||
echo "restart.sh: lb, api (all replicas), postgres, valkey and s3 restarted with volumes preserved"
|
||||
docker compose start relay worker
|
||||
echo "restart.sh: lb, api (all replicas), relay, worker, postgres, valkey, s3 and broker restarted with volumes preserved"
|
||||
|
||||
Reference in New Issue
Block a user