Serialize startup prepared artifact reclamation
This commit is contained in:
parent
acd0b4cc8c
commit
7cd8a90af0
1 changed files with 195 additions and 67 deletions
|
|
@ -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(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue