Implement lab 3 replica failover and shared idempotency for grade 4

This commit is contained in:
Алиса Шурман
2026-11-12 22:04:38 +03:00
parent 0ab3a341aa
commit 7da034885f
25 changed files with 1228 additions and 23 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
: "${TARGET_INSTANCE_ID:?Set TARGET_INSTANCE_ID to an API hostname}"
for id in $(docker compose ps -q api); do
hostname=$(docker inspect -f '{{.Config.Hostname}}' "$id")
if [ "$hostname" = "$TARGET_INSTANCE_ID" ]; then
docker stop -t 8 "$id"
exit 0
fi
done
echo 'Target is not a running API replica in this project' >&2
exit 1