forked from mtusi2026/mtusi2026lab5
65 lines
4.4 KiB
Plaintext
65 lines
4.4 KiB
Plaintext
python student-tests/run_failover.py
|
|
hook: scripts/stop-one.cmd; api replicas: ['48dc392933dc', 'c1b7e1ab5673']
|
|
|
|
=== run 1: containers before (HAProxy: api1 UP, api2 UP)
|
|
SERVICE CONTAINER STATE STARTED AT (UTC)
|
|
api 48dc392933dc running (healthy) 2026-10-26T16:24:32.726
|
|
api c1b7e1ab5673 running (healthy) 2026-10-26T16:18:45.657
|
|
broker 9f909ed7ecea running (healthy) 2026-10-26T16:19:00.163
|
|
lb 8be67a2e86b7 running (healthy) 2026-10-26T16:15:42.154
|
|
migrate a5a9934b4d6b exited 2026-10-26T16:23:38.842
|
|
postgres d2bfd48385f1 running (healthy) 2026-10-26T16:15:17.840
|
|
s3 892c7ca290f2 running (healthy) 2026-10-26T16:24:57.683
|
|
s3-init deab1aa2b022 exited 2026-10-26T16:23:38.843
|
|
valkey 4e223cb9301e running (healthy) 2026-10-26T16:15:17.820
|
|
worker 292a36c54a41 running (healthy) 2026-10-26T16:23:41.416
|
|
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
|
|
|
{"observed_instances_before": 2, "successful_writes": 124, "failed_attempts": 0, "first_recovery_seconds": 4.531}
|
|
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
containers after (HAProxy: api1 UP)
|
|
SERVICE CONTAINER STATE STARTED AT (UTC)
|
|
api 48dc392933dc exited 2026-10-26T16:24:32.726
|
|
api c1b7e1ab5673 running (healthy) 2026-10-26T16:18:45.657
|
|
broker 9f909ed7ecea running (healthy) 2026-10-26T16:19:00.163
|
|
lb 8be67a2e86b7 running (healthy) 2026-10-26T16:15:42.154
|
|
migrate a5a9934b4d6b exited 2026-10-26T16:23:38.842
|
|
postgres d2bfd48385f1 running (healthy) 2026-10-26T16:15:17.840
|
|
s3 892c7ca290f2 running (healthy) 2026-10-26T16:24:57.683
|
|
s3-init deab1aa2b022 exited 2026-10-26T16:23:38.843
|
|
valkey 4e223cb9301e running (healthy) 2026-10-26T16:15:17.820
|
|
worker 292a36c54a41 running (healthy) 2026-10-26T16:23:41.416
|
|
the hook stopped 48dc392933dc (X-Instance-Id of that replica = container ID); other api containers, postgres, valkey, s3 and lb kept running
|
|
restored: docker start 48dc392933dc -> healthy and back in HAProxy (api1 UP, api2 UP)
|
|
|
|
=== run 2: containers before (HAProxy: api1 UP, api2 UP)
|
|
SERVICE CONTAINER STATE STARTED AT (UTC)
|
|
api 48dc392933dc running (healthy) 2026-10-26T16:25:57.020
|
|
api c1b7e1ab5673 running (healthy) 2026-10-26T16:18:45.657
|
|
broker 9f909ed7ecea running (healthy) 2026-10-26T16:19:00.163
|
|
lb 8be67a2e86b7 running (healthy) 2026-10-26T16:15:42.154
|
|
migrate a5a9934b4d6b exited 2026-10-26T16:23:38.842
|
|
postgres d2bfd48385f1 running (healthy) 2026-10-26T16:15:17.840
|
|
s3 892c7ca290f2 running (healthy) 2026-10-26T16:24:57.683
|
|
s3-init deab1aa2b022 exited 2026-10-26T16:23:38.843
|
|
valkey 4e223cb9301e running (healthy) 2026-10-26T16:15:17.820
|
|
worker 292a36c54a41 running (healthy) 2026-10-26T16:23:41.416
|
|
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
|
|
|
{"observed_instances_before": 2, "successful_writes": 124, "failed_attempts": 0, "first_recovery_seconds": 4.594}
|
|
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
containers after (HAProxy: api2 UP)
|
|
SERVICE CONTAINER STATE STARTED AT (UTC)
|
|
api 48dc392933dc running (healthy) 2026-10-26T16:25:57.020
|
|
api c1b7e1ab5673 exited 2026-10-26T16:18:45.657
|
|
broker 9f909ed7ecea running (healthy) 2026-10-26T16:19:00.163
|
|
lb 8be67a2e86b7 running (healthy) 2026-10-26T16:15:42.154
|
|
migrate a5a9934b4d6b exited 2026-10-26T16:23:38.842
|
|
postgres d2bfd48385f1 running (healthy) 2026-10-26T16:15:17.840
|
|
s3 892c7ca290f2 running (healthy) 2026-10-26T16:24:57.683
|
|
s3-init deab1aa2b022 exited 2026-10-26T16:23:38.843
|
|
valkey 4e223cb9301e running (healthy) 2026-10-26T16:15:17.820
|
|
worker 292a36c54a41 running (healthy) 2026-10-26T16:23:41.416
|
|
the hook stopped c1b7e1ab5673 (X-Instance-Id of that replica = container ID); other api containers, postgres, valkey, s3 and lb kept running
|
|
restored: docker start c1b7e1ab5673 -> healthy and back in HAProxy (api1 UP, api2 UP)
|
|
|
|
PASS: public failover test passed 2 times; every api replica was stopped once and restored
|