ЛР 2: закрыть уровень 4

Завершить PostgreSQL, Redis-сессии, миграции, таймауты и диагностику. Зафиксировать собственные тесты и доказательства финального прогона: 43 PASS, 0 FAIL, 0 SKIP; 768 HTTP-запросов без ошибок. Добавить официальный отчёт с запуском, архитектурой, SQL-планами и ограничениями. PR отложен до завершения уровня 5.
This commit is contained in:
2026-10-28 13:30:26 +03:00
parent 65003b6119
commit 834876c938
288 changed files with 107634 additions and 19 deletions
@@ -0,0 +1,23 @@
{
"scope": "observed automated scenarios, not an automatic grade or manual report/CI review",
"results": [
{
"suite": "business-boundaries",
"status": "PASS",
"observation": null,
"duration_seconds": 0.4102
},
{
"suite": "business-cursors",
"status": "PASS",
"observation": null,
"duration_seconds": 0.4016
},
{
"suite": "read-after-write",
"status": "PASS",
"observation": null,
"duration_seconds": 0.2564
}
]
}
@@ -0,0 +1,10 @@
{"action": "restart-cache", "project": "lab2-test-7a19dc2f1e7a", "before": {"redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:18:11.86305309Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}, "after": {"redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:19:27.791991458Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}}
{"action": "restart-cache", "project": "lab2-test-7a19dc2f1e7a", "before": {"redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:19:27.791991458Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}, "after": {"redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:19:29.093800501Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}}
{"action": "restart", "project": "lab2-test-7a19dc2f1e7a", "before": {"api": {"id": "d7a9a294758de5b43c6ec656d25792b4ebd1c14fe02d83a0e31ab8a6d9a7e424", "started_at": "2026-10-25T20:18:18.20859126Z", "running": true, "volumes": []}, "postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:18:11.863149882Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}, "redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:19:29.093800501Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}, "after": {"api": {"id": "d7a9a294758de5b43c6ec656d25792b4ebd1c14fe02d83a0e31ab8a6d9a7e424", "started_at": "2026-10-25T20:20:27.161013916Z", "running": true, "volumes": []}, "postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:20:26.64658143Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}, "redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:20:26.548759764Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}}
{"action": "restart", "project": "lab2-test-7a19dc2f1e7a", "before": {"api": {"id": "d7a9a294758de5b43c6ec656d25792b4ebd1c14fe02d83a0e31ab8a6d9a7e424", "started_at": "2026-10-25T20:20:27.161013916Z", "running": true, "volumes": []}, "postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:20:26.64658143Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}, "redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:20:26.548759764Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}, "after": {"api": {"id": "d7a9a294758de5b43c6ec656d25792b4ebd1c14fe02d83a0e31ab8a6d9a7e424", "started_at": "2026-10-25T20:20:30.459130168Z", "running": true, "volumes": []}, "postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:20:30.191630335Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}, "redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:20:30.259507418Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}}
{"action": "restart", "project": "lab2-test-7a19dc2f1e7a", "before": {"api": {"id": "d7a9a294758de5b43c6ec656d25792b4ebd1c14fe02d83a0e31ab8a6d9a7e424", "started_at": "2026-10-25T20:20:30.459130168Z", "running": true, "volumes": []}, "postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:20:30.191630335Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}, "redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:20:30.259507418Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}, "after": {"api": {"id": "d7a9a294758de5b43c6ec656d25792b4ebd1c14fe02d83a0e31ab8a6d9a7e424", "started_at": "2026-10-25T20:21:06.540282421Z", "running": true, "volumes": []}, "postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:21:06.305072004Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}, "redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:21:06.231126254Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}}
{"action": "restart", "project": "lab2-test-7a19dc2f1e7a", "before": {"api": {"id": "d7a9a294758de5b43c6ec656d25792b4ebd1c14fe02d83a0e31ab8a6d9a7e424", "started_at": "2026-10-25T20:21:06.540282421Z", "running": true, "volumes": []}, "postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:21:06.305072004Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}, "redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:21:06.231126254Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}, "after": {"api": {"id": "d7a9a294758de5b43c6ec656d25792b4ebd1c14fe02d83a0e31ab8a6d9a7e424", "started_at": "2026-10-25T20:21:09.941738506Z", "running": true, "volumes": []}, "postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:21:09.693288922Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}, "redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:21:09.752192839Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}}
{"action": "stop-db", "project": "lab2-test-7a19dc2f1e7a", "before": {"postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:21:09.693288922Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}}, "after": {"postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:21:09.693288922Z", "running": false, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}}}
{"action": "start-db", "project": "lab2-test-7a19dc2f1e7a", "before": {"postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:21:09.693288922Z", "running": false, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}}, "after": {"postgres": {"id": "8684ac282a167aaab7f5391da71ae6bed11071c16c5963728216a3e51cccc9b8", "started_at": "2026-10-25T20:21:13.697782341Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_postgres_data"]}}}
{"action": "stop-cache", "project": "lab2-test-7a19dc2f1e7a", "before": {"redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:21:09.752192839Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}, "after": {"redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:21:09.752192839Z", "running": false, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}}
{"action": "start-cache", "project": "lab2-test-7a19dc2f1e7a", "before": {"redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:21:09.752192839Z", "running": false, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}, "after": {"redis": {"id": "c1248c511e82eb2ec8dbcafa94e3419934e01f5d5cd708067e7901ef90058e5e", "started_at": "2026-10-25T20:21:21.632899803Z", "running": true, "volumes": ["lab2-test-7a19dc2f1e7a_redis_data"]}}}
@@ -0,0 +1,189 @@
{
"scope": "observed automated scenarios, not an automatic grade or manual report/CI review",
"results": [
{
"suite": "sql-plan",
"status": "PASS",
"observation": {
"actual_rows": 10000,
"chat_distribution_percent": [
70,
20,
6,
3,
1
],
"chat_message_counts": [
7000,
2000,
600,
300,
100
],
"deep_page": {
"explain": {
"Execution Time": 0.024,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.004,
"Actual Total Time": 0.018,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 72,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.004,
"Actual Total Time": 0.015,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "((chat_id = 'f0de17f7-97e5-43ca-a32c-40c52e4ce64d'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:08.001+00'::timestamp with time zone, '5a5b6d5a-07cd-44e7-845a-432909ea9ada'::uuid)))",
"Index Name": "idx_messages_chat_created_id",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 1399,
"Plan Width": 72,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 532.11
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 19.67
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.022,
"Triggers": []
},
"max_visited_rows": 51
},
"first_page": {
"explain": {
"Execution Time": 0.015,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.003,
"Actual Total Time": 0.01,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 72,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.003,
"Actual Total Time": 0.006,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "(chat_id = 'f0de17f7-97e5-43ca-a32c-40c52e4ce64d'::uuid)",
"Index Name": "idx_messages_chat_created_id",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 7000,
"Plan Width": 72,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 838.42
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 6.39
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.022,
"Triggers": []
},
"max_visited_rows": 51
},
"go_version": "go1.27.1",
"mode": "plan",
"postgres_version": "18.6 (Debian 18.6-1.pgdg13+2)",
"rows": 10000,
"scan_budget_rows": 1000,
"schema": "lab2_test_f63d57f9d506426f8f700fd432fe41e1"
},
"duration_seconds": 1.6836
}
]
}
@@ -0,0 +1,97 @@
{
"project": "lab2-test-7a19dc2f1e7a",
"status": "FAIL",
"results": [
{
"check": "contracts",
"status": "PASS",
"seconds": 1.353
},
{
"check": "harness",
"status": "PASS",
"seconds": 0.088
},
{
"check": "lab2-harness",
"status": "PASS",
"seconds": 0.222
},
{
"check": "compose-up",
"status": "PASS",
"seconds": 37.853
},
{
"check": "go-race",
"status": "FAIL",
"detail": "CheckFailure"
},
{
"check": "go-build",
"status": "PASS",
"seconds": 3.001
},
{
"check": "go-vet",
"status": "PASS",
"seconds": 0.48
},
{
"check": "teacher-smoke",
"status": "PASS",
"seconds": 1.568
},
{
"check": "auth-normal",
"status": "PASS",
"seconds": 6.633
},
{
"check": "business",
"status": "PASS",
"seconds": 1.226
},
{
"check": "sql-plan-10000",
"status": "PASS",
"seconds": 1.772
},
{
"check": "teacher-persistence",
"status": "PASS",
"seconds": 2.888
},
{
"check": "auth-persistence",
"status": "PASS",
"seconds": 3.758
},
{
"check": "postgres-outage",
"status": "PASS",
"seconds": 3.574
},
{
"check": "redis-outage",
"status": "PASS",
"seconds": 8.389
},
{
"check": "short-ttl-api",
"status": "PASS",
"seconds": 0.611
},
{
"check": "auth-expiry",
"status": "PASS",
"seconds": 2.745
},
{
"check": "cleanup",
"status": "PASS",
"seconds": 0.888
}
],
"redis_fixture": "critical session store; explicit REDIS_ADDR=redis:6379 in test override"
}