forked from mtusi2026/mtusi2026lab4
53 lines
3.2 KiB
Plaintext
53 lines
3.2 KiB
Plaintext
# make test-failover: stop-one.sh останавливает реплику, обслужившую тест; затем вторую
|
|
# date: 2026-11-05T13:58:43Z
|
|
# commit: f8e41b1
|
|
|
|
## Прогон 1
|
|
### до
|
|
/messenger-lab4-api-1 id=bb4424f819bb running exit=0 finished=2026-11-05T13:58:37.640782752Z
|
|
/messenger-lab4-api-2 id=0900a35b199d running exit=0 finished=2026-11-05T13:58:37.58216166Z
|
|
|
|
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
|
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://lb:8080"
|
|
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
|
{"observed_instances_before": 2, "successful_writes": 125, "failed_attempts": 0, "first_recovery_seconds": 3.558}
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
|
|
### после: остановленная реплика Exited (0) — штатное завершение по SIGTERM
|
|
/messenger-lab4-api-1 id=bb4424f819bb running exit=0 finished=2026-11-05T13:58:37.640782752Z
|
|
/messenger-lab4-api-2 id=0900a35b199d exited exit=0 finished=2026-11-05T13:58:47.981063522Z
|
|
|
|
### журнал HAProxy
|
|
Server api/api1 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 1ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
|
|
Server api/api1 was DOWN and now enters maintenance (No IP for server ).
|
|
|
|
остановлена реплика: 0900a35b199d
|
|
|
|
## Прогон 2
|
|
### до
|
|
/messenger-lab4-api-1 id=bb4424f819bb running exit=0 finished=2026-11-05T13:58:37.640782752Z
|
|
/messenger-lab4-api-2 id=0900a35b199d running exit=0 finished=2026-11-05T13:58:47.981063522Z
|
|
|
|
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
|
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://lb:8080"
|
|
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
|
{"observed_instances_before": 2, "successful_writes": 130, "failed_attempts": 0, "first_recovery_seconds": 3.575}
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
|
|
### после: остановленная реплика Exited (0) — штатное завершение по SIGTERM
|
|
/messenger-lab4-api-1 id=bb4424f819bb exited exit=0 finished=2026-11-05T13:59:08.399118281Z
|
|
/messenger-lab4-api-2 id=0900a35b199d running exit=0 finished=2026-11-05T13:58:47.981063522Z
|
|
|
|
### журнал HAProxy
|
|
Server api/api1 is UP, reason: Layer7 check passed, code: 200, check duration: 2ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
|
|
Server api/api2 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 1ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
|
|
Server api/api2 was DOWN and now enters maintenance (No IP for server ).
|
|
|
|
остановлена реплика: bb4424f819bb
|
|
|
|
## Проверка guard: stop-one.sh отказывается останавливать не api
|
|
$ env TARGET_INSTANCE_ID=6285848df28a sh scripts/stop-one.sh
|
|
refusing to stop 6285848df28a: not an api replica of messenger-lab4 (messenger-lab4/postgres)
|
|
EXIT CODE 1
|
|
|