bigfix(gc): fix leak with GC and blob lifecycle
call fire_blob_hooks to respect lifecycle
dedup_service::garbage_collect_with_grac must call fire_blob_hooks() once blob are dropped
so other services like thumbnail can proceed to their cleanup
This commit is contained in:
@@ -1972,6 +1972,16 @@ impl DedupService {
|
|||||||
DomainError::internal_error("Dedup", format!("GC decrement chunks: {e}"))
|
DomainError::internal_error("Dedup", format!("GC decrement chunks: {e}"))
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
// Fire the blob hooks against the **manifest's file_hash** —
|
||||||
|
// that's the key thumbnails are stored under (whole-file
|
||||||
|
// BLAKE3, not chunk hashes). Phase 2 below fires hooks for
|
||||||
|
// individual chunk hashes only; without this call, a
|
||||||
|
// CDC-chunked file's thumbnails leak on disk because the
|
||||||
|
// chunk-keyed hook never finds them. Symptom: orphan webp
|
||||||
|
// under `.thumbnails/{icon,preview,large}/<file_hash>.webp`
|
||||||
|
// after a user-cascade-delete of a video upload.
|
||||||
|
self.fire_blob_hooks(file_hash);
|
||||||
|
|
||||||
total_bytes += *size as u64;
|
total_bytes += *size as u64;
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
"GC: removed manifest {} ({} chunks)",
|
"GC: removed manifest {} ({} chunks)",
|
||||||
|
|||||||
Reference in New Issue
Block a user