Serialize startup prepared artifact reclamation

This commit is contained in:
ms2k 2026-07-22 03:56:44 +09:00
commit 7cd8a90af0

View file

@ -232,20 +232,8 @@ where
.recover_preparations()
.map_err(|error| error.to_string())?;
failpoint(RecoveryBoundary::ArtifactGc, GenerationId::new(0))?;
let catalog_snapshot = catalog.snapshot().map_err(|error| error.to_string())?;
let selected = catalog_snapshot
.prepared_artifacts
.iter()
.filter(|artifact| {
!catalog_snapshot
.artifact_leases
.iter()
.any(|lease| lease.prepared_artifact_id == artifact.prepared_artifact_id)
})
.map(|artifact| artifact.prepared_artifact_id)
.collect::<Vec<_>>();
prepared
.gc_artifacts(&selected)
.gc_unleased_artifacts()
.map_err(|error| error.to_string())?;
Ok(())
}