feat(recoverable-job): add backend_consistency (storage)

This commit is contained in:
Edouard Vanbelle
2026-07-29 23:40:19 +02:00
parent 07beb461d6
commit 507bc2e98d
11 changed files with 844 additions and 0 deletions
+18
View File
@@ -1348,6 +1348,24 @@ impl AppServiceFactory {
.register_recoverable_job(&core.job_registry, &job_store_provider_dyn)
.await;
// Fifth recoverable-run tenant. Iterates the storage
// backend (via `BlobStorageBackend::list_blob_hashes`) and
// reports every physical blob that has no matching row in
// `storage.blobs`. Closes the reference graph together with
// `blobs_consistency`: this tenant walks backend→DB, that
// one walks DB→backend. Enumeration is backend-specific but
// the tenant is fully backend-agnostic — each backend owns
// its own layout knowledge (local walks `.blobs/`, S3 uses
// ListObjectsV2, migration wrapper refuses mid-migration).
let _ = Arc::new(
crate::infrastructure::services::backend_consistency_service::BackendConsistencyCheck::new(
maintenance_pool.clone(),
core.blob_backend.clone(),
),
)
.register_recoverable_job(&core.job_registry, &job_store_provider_dyn)
.await;
// "Run all consistency checks" coordinator. Plain JobHandler
// (not RecoverableJobHandler) — it dispatches, doesn't scan.
// MUST register AFTER every `*_consistency` tenant so the