forked from mtusi2026/mtusi2026lab4
Перенесён минимум lab3. Добавлены загрузка/скачивание PNG/JPEG через API с потоковой проверкой целостности, метаданные в PostgreSQL и байты в приватном bucket, отдельный S3-пользователь с ограниченными правами, идемпотентный bootstrap bucket, компенсация и reconciler (трек 2), тесты отказов, эксперименты по памяти и согласованности.
31 lines
2.6 KiB
Plaintext
31 lines
2.6 KiB
Plaintext
baseline (data left by earlier tests): {"deleted_objects": 0, "dry_run": true, "grace_seconds": 900, "marked_failed": 0, "missing_objects": 0, "objects_scanned": 113, "orphan_objects": 0, "protected_fresh_objects": 0, "removed_rows": 0, "rows_scanned": 86, "seconds": 0.17, "stale_uploading": 0}
|
|
== dry-run, grace=900 ==
|
|
{"deleted_objects": 0, "dry_run": true, "grace_seconds": 900, "marked_failed": 0, "missing_objects": 2, "objects_scanned": 118, "orphan_objects": 0, "protected_fresh_objects": 2, "removed_rows": 0, "rows_scanned": 89, "seconds": 0.087, "stale_uploading": 1}
|
|
ok dry-run: 1 new stale row (b), 2 old rows protected by young objects (a, h)
|
|
ok dry-run: 2 new missing objects (e, g)
|
|
ok dry-run changes nothing
|
|
== apply, grace=900 ==
|
|
{"deleted_objects": 0, "dry_run": false, "grace_seconds": 900, "marked_failed": 2, "missing_objects": 2, "objects_scanned": 118, "orphan_objects": 0, "protected_fresh_objects": 2, "removed_rows": 1, "rows_scanned": 89, "seconds": 0.1, "stale_uploading": 1}
|
|
ok old row whose object is young is kept (a)
|
|
ok stale row without object removed
|
|
ok fresh in-flight upload untouched
|
|
ok fresh orphan object kept inside grace
|
|
ok old row with a fresh object is left alone
|
|
ok recently confirmed row is not marked missing
|
|
ok missing unused object marked failed
|
|
ok used attachment with object untouched
|
|
ok used attachment with lost object kept, marked failed
|
|
== apply after grace expired (grace=2 after 3s) ==
|
|
{"deleted_objects": 4, "dry_run": false, "grace_seconds": 2, "marked_failed": 1, "missing_objects": 1, "objects_scanned": 115, "orphan_objects": 1, "protected_fresh_objects": 0, "removed_rows": 3, "rows_scanned": 115, "seconds": 0.126, "stale_uploading": 3}
|
|
ok orphan object deleted after grace
|
|
ok expired in-flight row collected after grace
|
|
ok old row + object collected once the object is older than grace (a, h)
|
|
ok used attachment still untouched
|
|
== second apply is idempotent ==
|
|
{"deleted_objects": 0, "dry_run": false, "grace_seconds": 2, "marked_failed": 0, "missing_objects": 0, "objects_scanned": 114, "orphan_objects": 0, "protected_fresh_objects": 0, "removed_rows": 0, "rows_scanned": 114, "seconds": 0.163, "stale_uploading": 0}
|
|
ok repeat run changes nothing
|
|
== cost of a full walk, 1000 ready attachments ==
|
|
{"deleted_objects": 0, "dry_run": true, "grace_seconds": 900, "marked_failed": 0, "missing_objects": 0, "objects_scanned": 1114, "orphan_objects": 0, "protected_fresh_objects": 0, "removed_rows": 0, "rows_scanned": 1087, "seconds": 1.63, "stale_uploading": 0}
|
|
ok bulk walk finds nothing wrong
|
|
RESULT: 18/18 checks passed
|