forked from mtusi2026/mtusi2026lab4
ЛР4: приватное S3-хранилище (SeaweedFS), вложения PNG/JPEG, reconciler, исследование согласованности
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
$ python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
$ python3 tests/smoke.py
|
||||
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
|
||||
# контейнеры до перезапуска:
|
||||
/mtusi-lab4-api-3 StartedAt=2026-10-02T23:34:55.153397385Z
|
||||
/mtusi-lab4-api-4 StartedAt=2026-10-02T23:34:55.348327032Z
|
||||
/mtusi-lab4-seaweedfs-1 StartedAt=2026-10-02T23:32:25.854895161Z
|
||||
/mtusi-lab4-postgres-1 StartedAt=2026-10-02T23:32:25.588611658Z
|
||||
/mtusi-lab2-postgres-1 StartedAt=2026-10-02T22:32:35.614573178Z
|
||||
/mtusi-lab4-valkey-1 StartedAt=2026-10-02T23:32:25.398680344Z
|
||||
/mtusi-lab2-valkey-1 StartedAt=2026-10-02T22:32:35.599034066Z
|
||||
$ python3 tests/resilience.py --mode persistence --action-script scripts/restart.sh (Windows: restart.cmd; проверяются и метаданные, и исходный файл в S3)
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
# контейнеры после перезапуска:
|
||||
/mtusi-lab4-api-3 StartedAt=2026-10-02T23:39:43.36427692Z
|
||||
/mtusi-lab4-api-4 StartedAt=2026-10-02T23:39:43.220921592Z
|
||||
/mtusi-lab4-seaweedfs-1 StartedAt=2026-10-02T23:39:40.130628797Z
|
||||
/mtusi-lab4-postgres-1 StartedAt=2026-10-02T23:39:39.628503986Z
|
||||
/mtusi-lab2-postgres-1 StartedAt=2026-10-02T22:32:35.614573178Z
|
||||
/mtusi-lab4-valkey-1 StartedAt=2026-10-02T23:39:39.858223769Z
|
||||
/mtusi-lab2-valkey-1 StartedAt=2026-10-02T22:32:35.599034066Z
|
||||
$ python3 tests/resilience.py --mode failover --action-script scripts/stop-one.sh (1-я реплика; файл скачивается другой репликой)
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 111, "failed_attempts": 0, "first_recovery_seconds": 2.328}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
$ ... (2-я реплика)
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 107, "failed_attempts": 0, "first_recovery_seconds": 2.328}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
$ python -m unittest test_api.py
|
||||
Ran 12 tests in 2.472s
|
||||
OK
|
||||
$ python -m unittest test_idempotency.py
|
||||
Ran 9 tests in 1.916s
|
||||
OK
|
||||
$ python -m unittest test_attachments.py
|
||||
Ran 11 tests in 4.632s
|
||||
OK
|
||||
$ python student-tests/test_topology.py
|
||||
Ran 6 tests in 1.485s
|
||||
OK
|
||||
$ python student-tests/test_s3_failures.py (остановка S3, сбои БД после записи в S3, reconcile)
|
||||
Ran 4 tests in 156.651s
|
||||
OK
|
||||
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"date": "2026-10-03 02:38:10",
|
||||
"cost_of_scan": [
|
||||
{
|
||||
"db_rows": 13271,
|
||||
"s3_objects": 13270,
|
||||
"timing_ms": {
|
||||
"db_query": 12.6,
|
||||
"s3_listing": 2073.5,
|
||||
"total": 2168.0
|
||||
},
|
||||
"upload_batch_seconds": 1.6
|
||||
},
|
||||
{
|
||||
"db_rows": 14271,
|
||||
"s3_objects": 14270,
|
||||
"timing_ms": {
|
||||
"db_query": 13.2,
|
||||
"s3_listing": 2241.4,
|
||||
"total": 2341.3
|
||||
},
|
||||
"upload_batch_seconds": 1.7
|
||||
},
|
||||
{
|
||||
"db_rows": 15271,
|
||||
"s3_objects": 15270,
|
||||
"timing_ms": {
|
||||
"db_query": 13.7,
|
||||
"s3_listing": 2401.3,
|
||||
"total": 2497.4
|
||||
},
|
||||
"upload_batch_seconds": 1.7
|
||||
}
|
||||
],
|
||||
"args": {
|
||||
"out": "evidence",
|
||||
"total": 3000
|
||||
},
|
||||
"injected": {
|
||||
"orphan_objects": 20,
|
||||
"missing_objects": 20,
|
||||
"size_mismatch": 5
|
||||
},
|
||||
"dry_run": {
|
||||
"orphan_objects_count": 20,
|
||||
"missing_objects_count": 20,
|
||||
"size_mismatch_count": 5,
|
||||
"orphans_skipped_fresh": 0,
|
||||
"timing_ms": {
|
||||
"db_query": 12.6,
|
||||
"s3_listing": 2408.1,
|
||||
"total": 2505.2
|
||||
},
|
||||
"fixed": {
|
||||
"deleted_orphans": 0,
|
||||
"marked_failed": 0
|
||||
}
|
||||
},
|
||||
"dry_run_repeatable": true,
|
||||
"dry_run_found_exactly_injected": true,
|
||||
"apply": {
|
||||
"fixed": {
|
||||
"deleted_orphans": 20,
|
||||
"marked_failed": 25
|
||||
},
|
||||
"orphans_skipped_fresh": 0,
|
||||
"timing_ms": {
|
||||
"db_query": 14.0,
|
||||
"s3_listing": 2429.5,
|
||||
"total": 2606.4
|
||||
},
|
||||
"orphan_objects_count": 20,
|
||||
"missing_objects_count": 20,
|
||||
"size_mismatch_count": 5
|
||||
},
|
||||
"fresh_uploads_during_apply": {
|
||||
"uploaded": 200,
|
||||
"intact": 200
|
||||
},
|
||||
"in_use_attachments_intact": "200/200",
|
||||
"second_apply_idempotent": {
|
||||
"fixed": {
|
||||
"deleted_orphans": 0,
|
||||
"marked_failed": 0
|
||||
},
|
||||
"orphan_objects_count": 0,
|
||||
"missing_objects_count": 0
|
||||
},
|
||||
"marked_failed": [
|
||||
"object_missing=20",
|
||||
"size_mismatch=5"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"date": "2026-10-03 02:33:53",
|
||||
"file_mib": 8.73,
|
||||
"clients": 12,
|
||||
"api_memory_limit": "256m",
|
||||
"runs": [
|
||||
{
|
||||
"UPLOAD_CONCURRENCY": 1,
|
||||
"statuses": {
|
||||
"201": 12
|
||||
},
|
||||
"wall_seconds": 1.35,
|
||||
"peak_rss_mib": 99.3,
|
||||
"rss_before_mib": 93.4,
|
||||
"rss_after_mib": 99.3,
|
||||
"oom_killed": "false",
|
||||
"accepted_files_intact": "12/12",
|
||||
"p50_s": 0.89,
|
||||
"max_s": 1.35
|
||||
},
|
||||
{
|
||||
"UPLOAD_CONCURRENCY": 4,
|
||||
"statuses": {
|
||||
"201": 12
|
||||
},
|
||||
"wall_seconds": 1.0,
|
||||
"peak_rss_mib": 116.1,
|
||||
"rss_before_mib": 93.9,
|
||||
"rss_after_mib": 116.1,
|
||||
"oom_killed": "false",
|
||||
"accepted_files_intact": "12/12",
|
||||
"p50_s": 0.79,
|
||||
"max_s": 0.99
|
||||
},
|
||||
{
|
||||
"UPLOAD_CONCURRENCY": 12,
|
||||
"statuses": {
|
||||
"201": 12
|
||||
},
|
||||
"wall_seconds": 1.05,
|
||||
"peak_rss_mib": 122.6,
|
||||
"rss_before_mib": 93.6,
|
||||
"rss_after_mib": 122.6,
|
||||
"oom_killed": "false",
|
||||
"accepted_files_intact": "12/12",
|
||||
"p50_s": 0.82,
|
||||
"max_s": 1.04
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user