27 lines
1.8 KiB
Plaintext
27 lines
1.8 KiB
Plaintext
Отказ первой API-реплики (public failover + прямое доказательство контейнера)
|
|
Дата: 2026-10-30, стек lab3, 2 API tasks за Traefik.
|
|
|
|
Public scenario (публичный тест не печатает target, только observed_instances/successes):
|
|
$ python tests/resilience.py --mode failover --action-script scripts/stop-one.cmd --base-url http://127.0.0.1:8080
|
|
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
|
{"observed_instances_before": 2, "successful_writes": 126, "failed_attempts": 2, "first_recovery_seconds": 3.016}
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
|
|
Operator evidence — остановлен именно контейнер, а не только заголовок:
|
|
$ TARGET_INSTANCE_ID=<X-Instance-Id из /health/live>
|
|
TARGET_INSTANCE_ID=db8a74090b22
|
|
stopping instance db8a74090b22 container db8a74090b22abb82912382eb619c8afe63c17c4e0074b6456cf0e06c1c14257
|
|
instance db8a74090b22 stopped
|
|
hook_seconds=3.172
|
|
|
|
$ docker service ps lab3_api --no-trunc
|
|
...
|
|
jp7oc0mllaoxx8trn9mibtn55 lab3_api.1 ... Running Running about a minute ago
|
|
kyybq2fofgzaom5jq42k564f6 lab3_api.2 ... Ready Pending less than a second ago
|
|
xujfndn4hslzoetuaepijcsx2 \_ lab3_api.2 ... Shutdown Complete less than a second ago
|
|
...
|
|
api restored: 2 running tasks and readiness OK
|
|
|
|
Наблюдение: target container id исчез из running, Swarm создал новую задачу с новым
|
|
hostname; X-Instance-Id остановленной реплики больше не встречается в ответах.
|
|
Ошибки переходного периода: 2 попытки POST, все повторены с исходным ключом. |