Files
mtusi2026lab5/evidence/failover/test-failover.md
T
2026-11-01 00:34:03 +03:00

34 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Отказ одной реплики API
- Команды: `make test-failover ACTION_SCRIPT=scripts/stop-one.sh STOP_MODE=stop STOP_ONE_LOG=<файл>`, `make replicas`, `make test-failover ACTION_SCRIPT=scripts/stop-one.sh STOP_MODE=kill STOP_ONE_LOG=<файл>`, `make replicas`, `make lb_stats`
- Дата: 2026-10-31, 20:41:38–20:42:18 UTC; оба прогона — код выхода 0
- Commit: `6ba74b1` (ветка `feat/unit-of-work`), рабочее дерево без правок кода (добавлены только файлы `evidence/`)
- Стенд: проект compose `mtusi-lab5`, собран `make run_docker` из `HEAD`
- `STOP_ONE_LOG` назвал реплику: в обоих прогонах `TARGET_INSTANCE_ID=057d8e7efce4`, контейнер `057d8e7efce4…`, остановленный контейнер совпадает с целью; между прогонами `make replicas` вернул реплику
## `stop`
```text
{"observed_instances_before": 2, "successful_writes": 116, "failed_attempts": 0, "first_recovery_seconds": 1.719}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
2026-10-31T20:41:40Z TARGET_INSTANCE_ID=057d8e7efce4 container=057d8e7efce4c79db09e10ea18dc662a247abe31ec2753d987f7cc8aa1ab365a mode=stop
```
## `kill`
```text
{"observed_instances_before": 2, "successful_writes": 123, "failed_attempts": 0, "first_recovery_seconds": 0.85}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
2026-10-31T20:42:00Z TARGET_INSTANCE_ID=057d8e7efce4 container=057d8e7efce4c79db09e10ea18dc662a247abe31ec2753d987f7cc8aa1ab365a mode=kill
```
## После `make replicas`
```text
svname addr status check_status scur stot econ wretr wredis hrsp_5xx
api-1 172.31.0.9:8080 UP L7OK 0 304 0 0 0 0
api-2 172.31.0.8:8080 UP L7OK 0 61 0 0 5 0
BACKEND - UP - 0 365 5 0 5 5
free slots: 6
```