Geo: Secondaries are orphaning artifact files
Problem
Since the release of parallel delete of job artifacts in 13.6 any artifacts which are deleted in this manner (nearly all of them) become orphaned on Geo secondaries.
Proposal
If fixing this before Job artifacts are migrated to the Geo framework:
- Add bulk insertion of
Geo::JobArtifactDeletedEvent
records during https://gitlab.com/gitlab-org/gitlab/-/blob/v13.7.3-ee/ee/app/services/ee/ci/destroy_expired_job_artifacts_service.rb#L11. - Add bulk insertion of
Geo::JobArtifactDeletedEvent
records during https://gitlab.com/gitlab-org/gitlab/-/blob/v13.7.3-ee/app/services/ci/destroy_pipeline_service.rb
If fixing this during &3114 (closed) then don't use Geo::JobArtifactDeletedEvent
. Make new events on the JobArtifactReplicator
class e.g. :pipeline_deleted
and job_artifact_batch_deleted
.
Workaround
Occasionally run a rake task on each secondary site https://docs.gitlab.com/ee/raketasks/cleanup.html#remove-orphan-artifact-files
Edited by Michael Kozono