forked from mtusi2026/mtusi2026lab5
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 (трек прошлой лабы) удалён: его роль выполняет уборка по журналу попыток.
22 lines
1.2 KiB
Bash
Executable File
22 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
# Restart hook for `make test-persistence ACTION_SCRIPT=scripts/restart.sh`.
|
|
# 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, 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, 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
|
|
docker compose start relay worker
|
|
echo "restart.sh: lb, api (all replicas), relay, worker, postgres, valkey, s3 and broker restarted with volumes preserved"
|