Implement durable S3 attachments and reconciliation

This commit is contained in:
Tmribob
2026-11-07 00:29:30 +03:00
parent ec540a1a72
commit 71d72c88b9
57 changed files with 4660 additions and 37 deletions
+18
View File
@@ -0,0 +1,18 @@
## Reconciler experiment — 2026-11-06
Synthetic unreferenced object `attachments/reconcile-orphan` was inserted directly
into the private S3 bucket. No PostgreSQL metadata row was created.
Dry-run immediately after insertion (`--grace-seconds 60`):
{"deleted_orphans":0,"eligible_orphans":0,"grace_seconds":60,"metadata_rows":8,"missing_metadata_objects":0,"mode":"dry_run","orphan_objects":1,"s3_objects":9}
Apply after the 60-second grace period:
{"deleted_orphans":1,"eligible_orphans":1,"grace_seconds":60,"metadata_rows":8,"missing_metadata_objects":0,"mode":"apply","orphan_objects":1,"s3_objects":9}
Final dry-run:
{"deleted_orphans":0,"eligible_orphans":0,"grace_seconds":60,"metadata_rows":8,"missing_metadata_objects":0,"mode":"dry_run","orphan_objects":0,"s3_objects":8}
The reconciler only deletes S3 keys under the generated `attachments/` prefix that
have no metadata and are older than the grace period. A missing S3 object is
reported but its metadata is retained for manual repair; referenced and fresh
objects are never candidates for deletion.