Implement lab 3 replicated API and transactional idempotency

This commit is contained in:
2026-11-19 11:33:31 +03:00
parent 0ab3a341aa
commit 1450f6ab69
31 changed files with 1170 additions and 31 deletions
+1
View File
@@ -0,0 +1 @@
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
+6
View File
@@ -0,0 +1,6 @@
{
"platform": "Windows-11-10.0.26200-SP0",
"cpu": "Intel64 Family 6 Model 186 Stepping 2, GenuineIntel",
"logical_cpus": 16,
"observed_at": "2026-11-19T08:26:42.137298+00:00"
}
+3
View File
@@ -0,0 +1,3 @@
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 85, "failed_attempts": 5, "first_recovery_seconds": 2.406}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+1
View File
@@ -0,0 +1 @@
{"service": "api1"}
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.157,
"concurrency": 4,
"successful_requests": 6542,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 216.931,
"successful_latency_ms": {
"p50": 16.0,
"p95": 32.0,
"p99": 78.0
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.157,
"concurrency": 4,
"successful_requests": 6542,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 216.931,
"successful_latency_ms": {
"p50": 16.0,
"p95": 32.0,
"p99": 78.0
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+2
View File
@@ -0,0 +1,2 @@
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
+35
View File
@@ -0,0 +1,35 @@
[
{
"scenario": "concurrent_idempotency",
"requests": 24,
"replicas": [
"api1",
"api2"
],
"unique_messages": 1
},
{
"scenario": "stop_api1",
"duration_seconds": 6.297,
"writes": 89,
"errors": 8,
"rps": 14.134,
"max_success_gap_seconds": 1.125
},
{
"scenario": "stop_api2",
"duration_seconds": 6.406,
"writes": 84,
"errors": 8,
"rps": 13.113,
"max_success_gap_seconds": 1.141
},
{
"scenario": "rolling_recreation",
"duration_seconds": 20.157,
"writes": 352,
"errors": 17,
"rps": 17.463,
"max_success_gap_seconds": 1.156
}
]
+61
View File
@@ -0,0 +1,61 @@
[
{
"scenario": "concurrent_idempotency",
"requests": 24,
"replicas": [
"api1",
"api2"
],
"unique_messages": 1
},
{
"scenario": "stop_api1",
"duration_seconds": 6.297,
"writes": 89,
"errors": 8,
"rps": 14.134,
"max_success_gap_seconds": 1.125
},
{
"scenario": "stop_api2",
"duration_seconds": 6.406,
"writes": 84,
"errors": 8,
"rps": 13.113,
"max_success_gap_seconds": 1.141
},
{
"scenario": "rolling_recreation",
"duration_seconds": 20.157,
"writes": 352,
"errors": 17,
"rps": 17.463,
"max_success_gap_seconds": 1.156
}
]
Container vp-lab3-api1-1 Stopping
Container vp-lab3-api1-1 Stopped
Container vp-lab3-api1-1 Created
Container vp-lab3-api1-1 Starting
Container vp-lab3-api1-1 Started
Container vp-lab3-api1-1 Waiting
Container vp-lab3-api1-1 Healthy
Container vp-lab3-api2-1 Stopping
Container vp-lab3-api2-1 Stopped
Container vp-lab3-api2-1 Created
Container vp-lab3-api2-1 Starting
Container vp-lab3-api2-1 Started
Container vp-lab3-api2-1 Waiting
Container vp-lab3-api2-1 Healthy
Container vp-lab3-api1-1 Recreate
Container vp-lab3-api1-1 Recreated
Container vp-lab3-api1-1 Starting
Container vp-lab3-api1-1 Started
Container vp-lab3-api1-1 Waiting
Container vp-lab3-api1-1 Healthy
Container vp-lab3-api2-1 Recreate
Container vp-lab3-api2-1 Recreated
Container vp-lab3-api2-1 Starting
Container vp-lab3-api2-1 Started
Container vp-lab3-api2-1 Waiting
Container vp-lab3-api2-1 Healthy
+30
View File
@@ -0,0 +1,30 @@
[
{
"at": "2026-11-19T08:26:11.185861+00:00",
"stats": "vp-lab3-api1-1 CPU=71.37% RAM=114MiB / 384MiB\nvp-lab3-api2-1 CPU=83.40% RAM=104.3MiB / 384MiB\nvp-lab3-db-1 CPU=42.70% RAM=39.61MiB / 512MiB\nvp-lab3-lb-1 CPU=23.50% RAM=13.06MiB / 128MiB\nvp-lab3-redis-1 CPU=0.57% RAM=8.145MiB / 128MiB"
},
{
"at": "2026-11-19T08:26:15.940158+00:00",
"stats": "vp-lab3-api1-1 CPU=73.52% RAM=104.2MiB / 384MiB\nvp-lab3-api2-1 CPU=73.55% RAM=104.2MiB / 384MiB\nvp-lab3-db-1 CPU=40.67% RAM=40.7MiB / 512MiB\nvp-lab3-lb-1 CPU=26.07% RAM=13.25MiB / 128MiB\nvp-lab3-redis-1 CPU=0.44% RAM=8.145MiB / 128MiB"
},
{
"at": "2026-11-19T08:26:20.721850+00:00",
"stats": "vp-lab3-api1-1 CPU=72.90% RAM=104.2MiB / 384MiB\nvp-lab3-api2-1 CPU=62.36% RAM=104.2MiB / 384MiB\nvp-lab3-db-1 CPU=40.12% RAM=41.57MiB / 512MiB\nvp-lab3-lb-1 CPU=28.37% RAM=13.84MiB / 128MiB\nvp-lab3-redis-1 CPU=0.30% RAM=8.27MiB / 128MiB"
},
{
"at": "2026-11-19T08:26:25.439797+00:00",
"stats": "vp-lab3-api1-1 CPU=63.82% RAM=105.6MiB / 384MiB\nvp-lab3-api2-1 CPU=86.69% RAM=105.9MiB / 384MiB\nvp-lab3-db-1 CPU=36.57% RAM=42.3MiB / 512MiB\nvp-lab3-lb-1 CPU=27.73% RAM=14.45MiB / 128MiB\nvp-lab3-redis-1 CPU=0.30% RAM=8.145MiB / 128MiB"
},
{
"at": "2026-11-19T08:26:30.206103+00:00",
"stats": "vp-lab3-api1-1 CPU=69.40% RAM=105.6MiB / 384MiB\nvp-lab3-api2-1 CPU=68.89% RAM=105.5MiB / 384MiB\nvp-lab3-db-1 CPU=44.58% RAM=43.32MiB / 512MiB\nvp-lab3-lb-1 CPU=28.67% RAM=14.51MiB / 128MiB\nvp-lab3-redis-1 CPU=0.31% RAM=8.145MiB / 128MiB"
},
{
"at": "2026-11-19T08:26:34.922520+00:00",
"stats": "vp-lab3-api1-1 CPU=67.82% RAM=105.7MiB / 384MiB\nvp-lab3-api2-1 CPU=60.80% RAM=105.5MiB / 384MiB\nvp-lab3-db-1 CPU=51.38% RAM=44.7MiB / 512MiB\nvp-lab3-lb-1 CPU=24.44% RAM=14.71MiB / 128MiB\nvp-lab3-redis-1 CPU=0.45% RAM=8.145MiB / 128MiB"
},
{
"at": "2026-11-19T08:26:39.660510+00:00",
"stats": "vp-lab3-api1-1 CPU=43.63% RAM=105.5MiB / 384MiB\nvp-lab3-api2-1 CPU=70.65% RAM=105.5MiB / 384MiB\nvp-lab3-db-1 CPU=30.53% RAM=45.79MiB / 512MiB\nvp-lab3-lb-1 CPU=20.64% RAM=14.63MiB / 128MiB\nvp-lab3-redis-1 CPU=0.33% RAM=8.145MiB / 128MiB"
}
]
+66
View File
@@ -0,0 +1,66 @@
{
"before": [
{
"name": "/vp-lab3-api1-1",
"id": "05fbc5e994b01d6a95d765f05e1adab9a2ebdbceec5b937dfc76fd76d90c8ee0",
"started_at": "2026-11-19T07:57:51.994317008Z",
"image": "vp-lab3-api"
},
{
"name": "/vp-lab3-api2-1",
"id": "e07b74f91369c4bdf08b6a50761518c79eed4804750dc1494510d97c9819a2f9",
"started_at": "2026-11-19T07:57:52.051494732Z",
"image": "vp-lab3-api"
},
{
"name": "/vp-lab3-db-1",
"id": "7eff663c0b92fb55ffbc87e0abf52c0b6cf9ed00848dc4c80f6c03c384af9fab",
"started_at": "2026-11-19T07:57:43.404724647Z",
"image": "postgres:16.6-bookworm"
},
{
"name": "/vp-lab3-lb-1",
"id": "a6c594cd39311a245af596bff7555d6006e5dccad65e8156dcea621f5255074d",
"started_at": "2026-11-19T07:57:55.966296377Z",
"image": "haproxy:3.0.6-alpine"
},
{
"name": "/vp-lab3-redis-1",
"id": "65e72fcdbc56d531d0a9e7b2d7ae712839b6cb9040193a63a5f3077bc82b0b65",
"started_at": "2026-11-19T07:57:43.415349754Z",
"image": "redis:7.4.1-bookworm"
}
],
"after": [
{
"name": "/vp-lab3-api1-1",
"id": "05fbc5e994b01d6a95d765f05e1adab9a2ebdbceec5b937dfc76fd76d90c8ee0",
"started_at": "2026-11-19T08:24:52.548786666Z",
"image": "vp-lab3-api"
},
{
"name": "/vp-lab3-api2-1",
"id": "e07b74f91369c4bdf08b6a50761518c79eed4804750dc1494510d97c9819a2f9",
"started_at": "2026-11-19T08:24:52.757877287Z",
"image": "vp-lab3-api"
},
{
"name": "/vp-lab3-db-1",
"id": "7eff663c0b92fb55ffbc87e0abf52c0b6cf9ed00848dc4c80f6c03c384af9fab",
"started_at": "2026-11-19T08:24:52.039125534Z",
"image": "postgres:16.6-bookworm"
},
{
"name": "/vp-lab3-lb-1",
"id": "a6c594cd39311a245af596bff7555d6006e5dccad65e8156dcea621f5255074d",
"started_at": "2026-11-19T08:24:52.750598261Z",
"image": "haproxy:3.0.6-alpine"
},
{
"name": "/vp-lab3-redis-1",
"id": "65e72fcdbc56d531d0a9e7b2d7ae712839b6cb9040193a63a5f3077bc82b0b65",
"started_at": "2026-11-19T08:24:52.755035623Z",
"image": "redis:7.4.1-bookworm"
}
]
}
+1
View File
@@ -0,0 +1 @@
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.