Prove per-replica failover and rolling replacement under load
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 20.0,
|
||||
"elapsed_seconds": 20.054,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 6170,
|
||||
"failed_requests": 5,
|
||||
"error_ratio": 0.00081,
|
||||
"successful_rps": 307.662,
|
||||
"successful_latency_ms": {
|
||||
"p50": 4.797,
|
||||
"p95": 47.602,
|
||||
"p99": 75.875
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"action": "stop one selected API replica",
|
||||
"target_container": "mtusi2026lab3-api-5",
|
||||
"target_container_id": "48b688fc10cbbf4a6e08c459308198ce08c200437b4da35fe4214a1cd4c65a15",
|
||||
"target_state_after_hook": "exited",
|
||||
"elapsed_seconds": 15.103,
|
||||
"stop_hook_seconds": 0.855,
|
||||
"successful_reads": 214,
|
||||
"failed_reads": 1,
|
||||
"successful_writes": 211,
|
||||
"failed_write_attempts": 1,
|
||||
"successful_rps": 28.141,
|
||||
"first_read_after_action_seconds": 2.555,
|
||||
"first_write_after_action_seconds": 2.489,
|
||||
"confirmed_messages_read_back": true
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
Commands: tests/load.py --duration 20 --concurrency 4, make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
Failover exit: 0
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://127.0.0.1:8083"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 112, "failed_attempts": 1, "first_recovery_seconds": 3.623}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
Load exit: 0
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 20.0,
|
||||
"elapsed_seconds": 20.054,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 6170,
|
||||
"failed_requests": 5,
|
||||
"error_ratio": 0.00081,
|
||||
"successful_rps": 307.662,
|
||||
"successful_latency_ms": {
|
||||
"p50": 4.797,
|
||||
"p95": 47.602,
|
||||
"p99": 75.875
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
Actual containers after hook:
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
mtusi2026lab3-api-5 mtusi2026lab3-api "python -m src.server" api 10 minutes ago Up About a minute (healthy) 8080/tcp
|
||||
mtusi2026lab3-api-6 mtusi2026lab3-api "python -m src.server" api 9 minutes ago Exited (0) 16 seconds ago
|
||||
mtusi2026lab3-lb-1 haproxy:3.0.11-alpine "docker-entrypoint.s…" lb About an hour ago Up 23 minutes 127.0.0.1:8083->8080/tcp
|
||||
mtusi2026lab3-migrate-1 mtusi2026lab3-migrate "python scripts/migr…" migrate 18 minutes ago Exited (0) 57 seconds ago
|
||||
mtusi2026lab3-postgres-1 postgres:17.6-bookworm "docker-entrypoint.s…" postgres 18 minutes ago Up 18 minutes (healthy) 5432/tcp
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"action": "stop one selected API replica",
|
||||
"target_container": "mtusi2026lab3-api-6",
|
||||
"target_container_id": "bef5f29c9a9d87f8cf60e49ecfd8edff762ba156184fb413d6008f81750b4f00",
|
||||
"target_state_after_hook": "exited",
|
||||
"elapsed_seconds": 15.152,
|
||||
"stop_hook_seconds": 0.864,
|
||||
"successful_reads": 210,
|
||||
"failed_reads": 1,
|
||||
"successful_writes": 209,
|
||||
"failed_write_attempts": 1,
|
||||
"successful_rps": 27.653,
|
||||
"first_read_after_action_seconds": 2.66,
|
||||
"first_write_after_action_seconds": 2.737,
|
||||
"confirmed_messages_read_back": true
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"action": "same-version sequential API replacement",
|
||||
"elapsed_seconds": 24.914,
|
||||
"successful_reads": 7212,
|
||||
"failed_reads": 2,
|
||||
"successful_writes": 4261,
|
||||
"failed_write_attempts": 2,
|
||||
"successful_idempotent_pairs": 302,
|
||||
"failed_pair_attempts": 2,
|
||||
"cross_replica_pairs": 151,
|
||||
"successful_rps": 484.749,
|
||||
"observed_instance_count": 4,
|
||||
"replacement_output": [
|
||||
"replaced API container bcd282fe6bdad720070e51cafc27b7084f647da7920c36e9f01e7fe56768dde7; two healthy replicas now serve traffic",
|
||||
"replaced API container 797d654ce2c993fcdc74628443ea8deb6b2e5eafe4b54940ab06ae273976c890; two healthy replicas now serve traffic"
|
||||
],
|
||||
"confirmed_messages_read_back": true
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
Environment: Darwin arm64
|
||||
Docker Engine: 29.5.2
|
||||
Compose: 5.3.1
|
||||
Docker VM CPUs/MemTotal: 2 / 2054832128 bytes
|
||||
Actual container limits (NanoCpus, Memory bytes):
|
||||
/mtusi2026lab3-api-5 500000000 268435456 running
|
||||
/mtusi2026lab3-api-6 500000000 268435456 running
|
||||
/mtusi2026lab3-lb-1 500000000 134217728 running
|
||||
/mtusi2026lab3-postgres-1 1000000000 536870912 running
|
||||
/mtusi2026lab3-migrate-1 500000000 134217728 exited
|
||||
Network/port and health observation:
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
mtusi2026lab3-api-5 mtusi2026lab3-api "python -m src.server" api 2 minutes ago Up 2 minutes (healthy) 8080/tcp
|
||||
mtusi2026lab3-api-6 mtusi2026lab3-api "python -m src.server" api 2 minutes ago Up 2 minutes (healthy) 8080/tcp
|
||||
mtusi2026lab3-lb-1 haproxy:3.0.11-alpine "docker-entrypoint.s…" lb About an hour ago Up 15 minutes 127.0.0.1:8083->8080/tcp
|
||||
mtusi2026lab3-migrate-1 mtusi2026lab3-migrate "python scripts/migr…" migrate 10 minutes ago Exited (0) 3 minutes ago
|
||||
mtusi2026lab3-postgres-1 postgres:17.6-bookworm "docker-entrypoint.s…" postgres 10 minutes ago Up 10 minutes (healthy) 5432/tcp
|
||||
Reference in New Issue
Block a user