Skip to content

Deleting pipeline is leaking storage space

Summary

New pipeline delete functionality does not delete artifacts associated with deleted pipeline/jobs. This means they are kept in filesystem/S3 and project statistics are not updated.

Additionally since the entries are removed from DB, it may be very hard to find and purge these files.

Introduced by gitlab-ce!22988

Steps to reproduce

Delete pipeline which has jobs with any artifacts (trace, artifacts, ...)
Observe statistics not changing.
Look at S3 bucket - file is present.
Look at DB, no reference to the file.

Example Project

https://gitlab.com/petermarko/delete-pipeline

What is the current bug behavior?

Artifacts are kept without any reference to them.

What is the expected correct behavior?

Artifacts are removed.

Relevant logs and/or screenshots

n/a

Output of checks

n/a

Results of GitLab environment info

GitLab CE 11.6.5 omnibus install with artifacts in AWS S3.

Reproduced on gitlab.com

Possible fixes

Use destroy_all instead of destroy in https://gitlab.com/gitlab-org/gitlab-ce/blob/de605ad1437e8e0beb5da76c900623dd541e1f72/app/services/ci/destroy_pipeline_service.rb#L10

Edited by Peter Marko