ЛР4: отчёт, MR и сырые доказательства проверок и экспериментов

This commit is contained in:
IvanMeln1k
2026-12-04 14:26:03 +03:00
parent f1fae32722
commit f23789d9f9
36 changed files with 4231 additions and 21 deletions
File diff suppressed because it is too large Load Diff
+65
View File
@@ -0,0 +1,65 @@
{
"generated_at": "2026-12-04T11:24:35.676430169Z",
"mode": "apply",
"bucket": "messenger-attachments",
"prefix": "attachments/",
"grace_seconds": 20,
"database": {
"rows": 328,
"ready": 328,
"pending": 0
},
"object_store": {
"objects": 327
},
"findings": {
"ok": 326,
"orphan_objects": [
{
"object_key": "attachments/orphan-fresh-883a12df6d1149159ff41dbad71a379b",
"age_seconds": 22
}
],
"protected_recent_objects": null,
"missing_objects": [
{
"id": "81598453-133b-4f7d-9119-7704874613d4",
"object_key": "attachments/81598453-133b-4f7d-9119-7704874613d4",
"status": "ready",
"age_seconds": 45
},
{
"id": "f3061162-21c7-4b31-8fd9-4e14bae915aa",
"object_key": "attachments/f3061162-21c7-4b31-8fd9-4e14bae915aa",
"status": "ready",
"age_seconds": 46
}
],
"stale_pending": null,
"protected_pending": null
},
"actions": {
"deleted_objects": [
"attachments/orphan-fresh-883a12df6d1149159ff41dbad71a379b"
],
"deleted_pending_rows": null,
"skipped": null,
"unresolved_missing": [
"81598453-133b-4f7d-9119-7704874613d4",
"f3061162-21c7-4b31-8fd9-4e14bae915aa"
],
"errors": null
},
"timing": {
"db_scan_ms": 4,
"s3_list_ms": 6,
"total_ms": 11,
"db_rows": 328,
"s3_objects": 327
},
"_invocation": {
"command": "/Users/ivanmuller/Desktop/oh_my_life/highload/lab4/scripts/compose.sh --env-file .env run --rm --no-deps -T --entrypoint /app/reconciler api -prefix attachments/ -grace 20s -apply",
"started_at": "2026-12-04T11:24:35.480419Z",
"finished_at": "2026-12-04T11:24:35.697544Z"
}
}
+96
View File
@@ -0,0 +1,96 @@
{
"generated_at": "2026-12-04T11:24:15.098478955Z",
"mode": "apply",
"bucket": "messenger-attachments",
"prefix": "attachments/",
"grace_seconds": 20,
"database": {
"rows": 330,
"ready": 327,
"pending": 3
},
"object_store": {
"objects": 329
},
"findings": {
"ok": 325,
"orphan_objects": [
{
"object_key": "attachments/orphan-stale-fcbe6b1db6e2499b856297fdfad8ab63",
"age_seconds": 23
}
],
"protected_recent_objects": [
{
"object_key": "attachments/orphan-fresh-883a12df6d1149159ff41dbad71a379b",
"age_seconds": 2
}
],
"missing_objects": [
{
"id": "81598453-133b-4f7d-9119-7704874613d4",
"object_key": "attachments/81598453-133b-4f7d-9119-7704874613d4",
"status": "ready",
"age_seconds": 25
},
{
"id": "f3061162-21c7-4b31-8fd9-4e14bae915aa",
"object_key": "attachments/f3061162-21c7-4b31-8fd9-4e14bae915aa",
"status": "ready",
"age_seconds": 25
}
],
"stale_pending": [
{
"id": "58898af9-b2b0-4d4d-9b90-181560fce9f4",
"object_key": "attachments/58898af9-b2b0-4d4d-9b90-181560fce9f4",
"status": "pending",
"age_seconds": 82,
"object_present": true
},
{
"id": "d4b7a45c-57a5-4de6-9255-647fee5bb7f5",
"object_key": "attachments/d4b7a45c-57a5-4de6-9255-647fee5bb7f5",
"status": "pending",
"age_seconds": 82
}
],
"protected_pending": [
{
"id": "912aa2d3-f0c3-4f8d-b1a9-ad4d008411a8",
"object_key": "attachments/912aa2d3-f0c3-4f8d-b1a9-ad4d008411a8",
"status": "pending",
"age_seconds": 1,
"object_present": true
}
]
},
"actions": {
"deleted_objects": [
"attachments/orphan-stale-fcbe6b1db6e2499b856297fdfad8ab63",
"attachments/58898af9-b2b0-4d4d-9b90-181560fce9f4"
],
"deleted_pending_rows": [
"58898af9-b2b0-4d4d-9b90-181560fce9f4",
"d4b7a45c-57a5-4de6-9255-647fee5bb7f5"
],
"skipped": null,
"unresolved_missing": [
"81598453-133b-4f7d-9119-7704874613d4",
"f3061162-21c7-4b31-8fd9-4e14bae915aa"
],
"errors": null
},
"timing": {
"db_scan_ms": 4,
"s3_list_ms": 5,
"total_ms": 12,
"db_rows": 330,
"s3_objects": 329
},
"_invocation": {
"command": "/Users/ivanmuller/Desktop/oh_my_life/highload/lab4/scripts/compose.sh --env-file .env run --rm --no-deps -T --entrypoint /app/reconciler api -prefix attachments/ -grace 20s -apply",
"started_at": "2026-12-04T11:24:14.919301Z",
"finished_at": "2026-12-04T11:24:15.121475Z"
}
}
+42
View File
@@ -0,0 +1,42 @@
{
"generated_at": "2026-12-04T11:23:51.245733676Z",
"mode": "apply",
"bucket": "messenger-attachments",
"prefix": "attachments/",
"grace_seconds": 20,
"database": {
"rows": 321,
"ready": 321,
"pending": 0
},
"object_store": {
"objects": 321
},
"findings": {
"ok": 321,
"orphan_objects": null,
"protected_recent_objects": null,
"missing_objects": null,
"stale_pending": null,
"protected_pending": null
},
"actions": {
"deleted_objects": null,
"deleted_pending_rows": null,
"skipped": null,
"unresolved_missing": null,
"errors": null
},
"timing": {
"db_scan_ms": 3,
"s3_list_ms": 6,
"total_ms": 10,
"db_rows": 321,
"s3_objects": 321
},
"_invocation": {
"command": "/Users/ivanmuller/Desktop/oh_my_life/highload/lab4/scripts/compose.sh --env-file .env run --rm --no-deps -T --entrypoint /app/reconciler api -prefix attachments/ -grace 20s -apply",
"started_at": "2026-12-04T11:23:51.035527Z",
"finished_at": "2026-12-04T11:23:51.230239Z"
}
}
+42
View File
@@ -0,0 +1,42 @@
{
"generated_at": "2026-12-04T11:23:51.428797769Z",
"mode": "dry-run",
"bucket": "messenger-attachments",
"prefix": "attachments/",
"grace_seconds": 3600,
"database": {
"rows": 321,
"ready": 321,
"pending": 0
},
"object_store": {
"objects": 321
},
"findings": {
"ok": 321,
"orphan_objects": null,
"protected_recent_objects": null,
"missing_objects": null,
"stale_pending": null,
"protected_pending": null
},
"actions": {
"deleted_objects": null,
"deleted_pending_rows": null,
"skipped": null,
"unresolved_missing": null,
"errors": null
},
"timing": {
"db_scan_ms": 4,
"s3_list_ms": 6,
"total_ms": 11,
"db_rows": 321,
"s3_objects": 321
},
"_invocation": {
"command": "/Users/ivanmuller/Desktop/oh_my_life/highload/lab4/scripts/compose.sh --env-file .env run --rm --no-deps -T --entrypoint /app/reconciler api -prefix attachments/ -grace 3600s",
"started_at": "2026-12-04T11:23:51.230684Z",
"finished_at": "2026-12-04T11:23:51.423909Z"
}
}
+42
View File
@@ -0,0 +1,42 @@
{
"generated_at": "2026-12-04T11:23:51.632662912Z",
"mode": "dry-run",
"bucket": "messenger-attachments",
"prefix": "attachments/",
"grace_seconds": 3600,
"database": {
"rows": 321,
"ready": 321,
"pending": 0
},
"object_store": {
"objects": 321
},
"findings": {
"ok": 321,
"orphan_objects": null,
"protected_recent_objects": null,
"missing_objects": null,
"stale_pending": null,
"protected_pending": null
},
"actions": {
"deleted_objects": null,
"deleted_pending_rows": null,
"skipped": null,
"unresolved_missing": null,
"errors": null
},
"timing": {
"db_scan_ms": 3,
"s3_list_ms": 6,
"total_ms": 10,
"db_rows": 321,
"s3_objects": 321
},
"_invocation": {
"command": "/Users/ivanmuller/Desktop/oh_my_life/highload/lab4/scripts/compose.sh --env-file .env run --rm --no-deps -T --entrypoint /app/reconciler api -prefix attachments/ -grace 3600s",
"started_at": "2026-12-04T11:23:51.424365Z",
"finished_at": "2026-12-04T11:23:51.620127Z"
}
}
+42
View File
@@ -0,0 +1,42 @@
{
"generated_at": "2026-12-04T11:23:51.829841874Z",
"mode": "dry-run",
"bucket": "messenger-attachments",
"prefix": "attachments/",
"grace_seconds": 3600,
"database": {
"rows": 321,
"ready": 321,
"pending": 0
},
"object_store": {
"objects": 321
},
"findings": {
"ok": 321,
"orphan_objects": null,
"protected_recent_objects": null,
"missing_objects": null,
"stale_pending": null,
"protected_pending": null
},
"actions": {
"deleted_objects": null,
"deleted_pending_rows": null,
"skipped": null,
"unresolved_missing": null,
"errors": null
},
"timing": {
"db_scan_ms": 4,
"s3_list_ms": 5,
"total_ms": 10,
"db_rows": 321,
"s3_objects": 321
},
"_invocation": {
"command": "/Users/ivanmuller/Desktop/oh_my_life/highload/lab4/scripts/compose.sh --env-file .env run --rm --no-deps -T --entrypoint /app/reconciler api -prefix attachments/ -grace 3600s",
"started_at": "2026-12-04T11:23:51.620875Z",
"finished_at": "2026-12-04T11:23:51.815816Z"
}
}
+95
View File
@@ -0,0 +1,95 @@
{
"generated_at": "2026-12-04T11:24:14.412126069Z",
"mode": "dry-run",
"bucket": "messenger-attachments",
"prefix": "attachments/",
"grace_seconds": 20,
"database": {
"rows": 324,
"ready": 321,
"pending": 3
},
"object_store": {
"objects": 323
},
"findings": {
"ok": 319,
"orphan_objects": [
{
"object_key": "attachments/orphan-stale-fcbe6b1db6e2499b856297fdfad8ab63",
"age_seconds": 22
}
],
"protected_recent_objects": [
{
"object_key": "attachments/orphan-fresh-883a12df6d1149159ff41dbad71a379b",
"age_seconds": 1
}
],
"missing_objects": [
{
"id": "81598453-133b-4f7d-9119-7704874613d4",
"object_key": "attachments/81598453-133b-4f7d-9119-7704874613d4",
"status": "ready",
"age_seconds": 24
},
{
"id": "f3061162-21c7-4b31-8fd9-4e14bae915aa",
"object_key": "attachments/f3061162-21c7-4b31-8fd9-4e14bae915aa",
"status": "ready",
"age_seconds": 25
}
],
"stale_pending": [
{
"id": "58898af9-b2b0-4d4d-9b90-181560fce9f4",
"object_key": "attachments/58898af9-b2b0-4d4d-9b90-181560fce9f4",
"status": "pending",
"age_seconds": 82,
"object_present": true
},
{
"id": "d4b7a45c-57a5-4de6-9255-647fee5bb7f5",
"object_key": "attachments/d4b7a45c-57a5-4de6-9255-647fee5bb7f5",
"status": "pending",
"age_seconds": 82
}
],
"protected_pending": [
{
"id": "912aa2d3-f0c3-4f8d-b1a9-ad4d008411a8",
"object_key": "attachments/912aa2d3-f0c3-4f8d-b1a9-ad4d008411a8",
"status": "pending",
"age_seconds": 0,
"object_present": true
}
]
},
"actions": {
"planned_deletes": [
"attachments/orphan-stale-fcbe6b1db6e2499b856297fdfad8ab63",
"attachments/58898af9-b2b0-4d4d-9b90-181560fce9f4",
"attachments/d4b7a45c-57a5-4de6-9255-647fee5bb7f5"
],
"deleted_objects": null,
"deleted_pending_rows": null,
"skipped": null,
"unresolved_missing": [
"81598453-133b-4f7d-9119-7704874613d4",
"f3061162-21c7-4b31-8fd9-4e14bae915aa"
],
"errors": null
},
"timing": {
"db_scan_ms": 3,
"s3_list_ms": 6,
"total_ms": 10,
"db_rows": 324,
"s3_objects": 323
},
"_invocation": {
"command": "/Users/ivanmuller/Desktop/oh_my_life/highload/lab4/scripts/compose.sh --env-file .env run --rm --no-deps -T --entrypoint /app/reconciler api -prefix attachments/ -grace 20s",
"started_at": "2026-12-04T11:24:14.223154Z",
"finished_at": "2026-12-04T11:24:14.429771Z"
}
}
+63
View File
@@ -0,0 +1,63 @@
{
"generated_at": "2026-12-04T11:24:16.1372083Z",
"mode": "apply",
"bucket": "messenger-attachments",
"prefix": "attachments/",
"grace_seconds": 20,
"database": {
"rows": 328,
"ready": 328,
"pending": 0
},
"object_store": {
"objects": 327
},
"findings": {
"ok": 326,
"orphan_objects": null,
"protected_recent_objects": [
{
"object_key": "attachments/orphan-fresh-883a12df6d1149159ff41dbad71a379b",
"age_seconds": 3
}
],
"missing_objects": [
{
"id": "81598453-133b-4f7d-9119-7704874613d4",
"object_key": "attachments/81598453-133b-4f7d-9119-7704874613d4",
"status": "ready",
"age_seconds": 26
},
{
"id": "f3061162-21c7-4b31-8fd9-4e14bae915aa",
"object_key": "attachments/f3061162-21c7-4b31-8fd9-4e14bae915aa",
"status": "ready",
"age_seconds": 26
}
],
"stale_pending": null,
"protected_pending": null
},
"actions": {
"deleted_objects": null,
"deleted_pending_rows": null,
"skipped": null,
"unresolved_missing": [
"81598453-133b-4f7d-9119-7704874613d4",
"f3061162-21c7-4b31-8fd9-4e14bae915aa"
],
"errors": null
},
"timing": {
"db_scan_ms": 3,
"s3_list_ms": 7,
"total_ms": 11,
"db_rows": 328,
"s3_objects": 327
},
"_invocation": {
"command": "/Users/ivanmuller/Desktop/oh_my_life/highload/lab4/scripts/compose.sh --env-file .env run --rm --no-deps -T --entrypoint /app/reconciler api -prefix attachments/ -grace 20s -apply",
"started_at": "2026-12-04T11:24:15.952591Z",
"finished_at": "2026-12-04T11:24:16.144853Z"
}
}
+406
View File
@@ -0,0 +1,406 @@
{
"track": "Track 2: consistency of two stores",
"hypothesis": "A grace-protected, re-checked reconciler removes only stale orphan objects and stale upload intents, and never deletes ready/used/fresh attachments or invents missing bytes.",
"generated_at": "2026-12-04T11:24:35.880770Z",
"git_revision": "f1fae32722dd89c48369ae92a303287c93490ed0",
"api_image_id": "sha256:743995b25b1abba227d84d4e23f016e2121916cc68f4c032670eb8c24203314b",
"database_rows_base": 300,
"object_store_objects_base": 300,
"message_attachment_links_base": 160,
"base_profile": {
"attachments": 300,
"linked_attachments": 150,
"unlinked_ready_attachments": 150,
"bytes_per_attachment": 111817,
"total_attachment_bytes": 33545100,
"image_profile": "tests/fixtures/sample.png 320x200, identical synthetic bytes"
},
"grace_seconds": 20,
"cost_runs": [
{
"run": 1,
"generated_at": "2026-12-04T11:23:51.428797769Z",
"db_scan_ms": 4,
"s3_list_ms": 6,
"total_ms": 11,
"db_rows": 321,
"s3_objects": 321
},
{
"run": 2,
"generated_at": "2026-12-04T11:23:51.632662912Z",
"db_scan_ms": 3,
"s3_list_ms": 6,
"total_ms": 10,
"db_rows": 321,
"s3_objects": 321
},
{
"run": 3,
"generated_at": "2026-12-04T11:23:51.829841874Z",
"db_scan_ms": 4,
"s3_list_ms": 5,
"total_ms": 10,
"db_rows": 321,
"s3_objects": 321
}
],
"cost_summary": {
"runs": 3,
"db_scan_ms_median": 4,
"s3_list_ms_median": 6,
"total_ms_median": 10,
"note": "traversal cost is O(rows + objects); timings are wall-clock milliseconds reported by the reconciler process on this local stand"
},
"injected": {
"stale_orphan_object": "attachments/orphan-stale-fcbe6b1db6e2499b856297fdfad8ab63",
"stale_pending_with_object": {
"id": "58898af9-b2b0-4d4d-9b90-181560fce9f4",
"object_key": "attachments/58898af9-b2b0-4d4d-9b90-181560fce9f4"
},
"stale_pending_without_object": {
"id": "d4b7a45c-57a5-4de6-9255-647fee5bb7f5",
"object_key": "attachments/d4b7a45c-57a5-4de6-9255-647fee5bb7f5"
},
"missing_used_attachment": {
"id": "f3061162-21c7-4b31-8fd9-4e14bae915aa",
"object_key": "attachments/f3061162-21c7-4b31-8fd9-4e14bae915aa"
},
"missing_unused_attachment": {
"id": "81598453-133b-4f7d-9119-7704874613d4",
"object_key": "attachments/81598453-133b-4f7d-9119-7704874613d4"
},
"fresh_orphan_object": "attachments/orphan-fresh-883a12df6d1149159ff41dbad71a379b",
"active_upload_intent": {
"id": "912aa2d3-f0c3-4f8d-b1a9-ad4d008411a8",
"object_key": "attachments/912aa2d3-f0c3-4f8d-b1a9-ad4d008411a8"
}
},
"dry_run": {
"orphan_objects": [
"attachments/orphan-stale-fcbe6b1db6e2499b856297fdfad8ab63"
],
"protected_recent_objects": [
"attachments/orphan-fresh-883a12df6d1149159ff41dbad71a379b"
],
"stale_pending": [
"58898af9-b2b0-4d4d-9b90-181560fce9f4",
"d4b7a45c-57a5-4de6-9255-647fee5bb7f5"
],
"protected_pending": [
"912aa2d3-f0c3-4f8d-b1a9-ad4d008411a8"
],
"missing_objects": [
"81598453-133b-4f7d-9119-7704874613d4",
"f3061162-21c7-4b31-8fd9-4e14bae915aa"
],
"deleted_objects": [],
"deleted_pending_rows": []
},
"apply": {
"deleted_objects": [
"attachments/58898af9-b2b0-4d4d-9b90-181560fce9f4",
"attachments/orphan-stale-fcbe6b1db6e2499b856297fdfad8ab63"
],
"deleted_pending_rows": [
"58898af9-b2b0-4d4d-9b90-181560fce9f4",
"d4b7a45c-57a5-4de6-9255-647fee5bb7f5"
],
"unresolved_missing": [
"81598453-133b-4f7d-9119-7704874613d4",
"f3061162-21c7-4b31-8fd9-4e14bae915aa"
]
},
"rerun": {
"deleted_objects": [],
"deleted_pending_rows": []
},
"after_grace": {
"deleted_objects": [
"attachments/orphan-fresh-883a12df6d1149159ff41dbad71a379b"
],
"deleted_pending_rows": []
},
"assertions": [
{
"check": "base attachment set is incomplete",
"passed": true
},
{
"check": "message attachments were reordered",
"passed": true
},
{
"check": "base rows/objects were not exactly the 300 uploads",
"passed": true
},
{
"check": "cost run did not scan the full base set",
"passed": true
},
{
"check": "missing objects were not removed from S3",
"passed": true
},
{
"check": "stale orphan object not detected",
"passed": true
},
{
"check": "fresh orphan object not protected",
"passed": true
},
{
"check": "stale upload intents not detected",
"passed": true
},
{
"check": "fresh upload intent not protected",
"passed": true
},
{
"check": "missing objects not detected",
"passed": true
},
{
"check": "dry run deleted objects",
"passed": true
},
{
"check": "dry run deleted rows",
"passed": true
},
{
"check": "dry run mutated either store",
"passed": true
},
{
"check": "dry run removed an object",
"passed": true
},
{
"check": "dry run removed an active upload object",
"passed": true
},
{
"check": "concurrent upload during reconcile did not finish ready",
"passed": true
},
{
"check": "stale orphan object was not removed",
"passed": true
},
{
"check": "stale pending rows were not removed",
"passed": true
},
{
"check": "stale pending object was not removed",
"passed": true
},
{
"check": "stale S3 objects survived apply",
"passed": true
},
{
"check": "stale pending rows survived apply",
"passed": true
},
{
"check": "fresh orphan object was deleted inside grace",
"passed": true
},
{
"check": "active upload, concurrent upload or active row was deleted",
"passed": true
},
{
"check": "missing objects were not left for manual recovery",
"passed": true
},
{
"check": "apply changed message attachment links",
"passed": true
},
{
"check": "active upload intent changed state unexpectedly",
"passed": true
},
{
"check": "protected upload cannot be attached after completion",
"passed": true
},
{
"check": "protected upload bytes changed",
"passed": true
},
{
"check": "rerun deleted objects",
"passed": true
},
{
"check": "rerun deleted rows",
"passed": true
},
{
"check": "fresh orphan lost protection on rerun",
"passed": true
},
{
"check": "fresh orphan removed on rerun",
"passed": true
},
{
"check": "aged orphan was not removed after grace",
"passed": true
},
{
"check": "aged orphan object still exists",
"passed": true
},
{
"check": "grace expiry deleted a metadata row",
"passed": true
},
{
"check": "completed protected attachment lost after grace expiry",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used message disappeared from history",
"passed": true
},
{
"check": "used message lost or reordered its attachment links",
"passed": true
},
{
"check": "used attachment bytes changed or disappeared",
"passed": true
},
{
"check": "new upload after reconciliation failed",
"passed": true
}
],
"assertions_failed": 0,
"result": "PASS",
"limitations": [
"The reconciler never deletes or fabricates a missing original: bytes cannot be restored automatically, so those rows are reported as unresolved for operator recovery.",
"A simulated in-flight upload row is used as the deterministic active state; real concurrent uploads are additionally exercised and must finish ready.",
"Cost is measured on this 2 vCPU / ~2 GiB Colima stand and does not extrapolate to production.",
"The S3 ListObjects scan is not a snapshot: concurrent uploads are protected by the grace period and by the immediate database re-check before each delete."
]
}