forked from mtusi2026/mtusi2026lab3
48 lines
3.0 KiB
Plaintext
48 lines
3.0 KiB
Plaintext
# make test-failover: stop-one.sh останавливает реплику, обслужившую тест; затем вторую
|
|
# date: 2026-11-01T14:54:02Z
|
|
# commit: 252ebd0
|
|
|
|
## Прогон 1
|
|
### до
|
|
/messenger-lab3-api-11 id=e0c31d893858 running exit=0 finished=2026-11-01T14:53:57.668890771Z
|
|
/messenger-lab3-api-12 id=229dcf033bdc running exit=0 finished=2026-11-01T14:53:57.66803913Z
|
|
|
|
$ 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": 132, "failed_attempts": 0, "first_recovery_seconds": 3.509}
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
|
|
### после: остановленная реплика Exited (0) — штатное завершение по SIGTERM
|
|
/messenger-lab3-api-11 id=e0c31d893858 exited exit=0 finished=2026-11-01T14:54:05.746763923Z
|
|
/messenger-lab3-api-12 id=229dcf033bdc running exit=0 finished=2026-11-01T14:53:57.66803913Z
|
|
|
|
### журнал HAProxy
|
|
Server api/api2 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 2ms. 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 ).
|
|
|
|
## Прогон 2
|
|
### до
|
|
/messenger-lab3-api-11 id=e0c31d893858 running exit=0 finished=2026-11-01T14:54:05.746763923Z
|
|
/messenger-lab3-api-12 id=229dcf033bdc running exit=0 finished=2026-11-01T14:53:57.66803913Z
|
|
|
|
$ 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": 131, "failed_attempts": 0, "first_recovery_seconds": 3.668}
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
|
|
### после: остановленная реплика Exited (0) — штатное завершение по SIGTERM
|
|
/messenger-lab3-api-11 id=e0c31d893858 running exit=0 finished=2026-11-01T14:54:05.746763923Z
|
|
/messenger-lab3-api-12 id=229dcf033bdc exited exit=0 finished=2026-11-01T14:54:25.301405146Z
|
|
|
|
### журнал 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 ).
|
|
|
|
## Проверка guard: stop-one.sh отказывается останавливать не api
|
|
$ env TARGET_INSTANCE_ID=eb4e6be5ba1d sh scripts/stop-one.sh
|
|
refusing to stop eb4e6be5ba1d: not an api replica of messenger-lab3 (messenger-lab3/postgres)
|
|
EXIT CODE 1
|
|
|