Story #8368
closedLimit number of old repository versions.
100%
Description
As an application maintainer, I would like to be able to specify how many old versions of a repository to keep in order to keep the size of my database from growing out of control.
I would like to be able to:
- specify a default number of repo versions to keep for a specific repository type.
- ex: allow me to keep that last 200 versions for all AnsibleRepository types and keep all versions for all ContainerRepository types
- override the default number of repo versions to keep on a repo by repo basis.
- ex: allow me to specify that repo
staging
should keep all versions and reporejected
should keep the last 5 repo versions
- ex: allow me to specify that repo
Related issues
Updated by mdellweg over 3 years ago
I hear, there cold be a int-field on repository to specify the number of retained versions. And the context manager that creates versions could clean up in its __exit__
method.
The question i see if there would be a way to mark precious versions that should not be deleted. What do we do with versions that are linked to a publication / distribution?
Updated by ttereshc over 3 years ago
- Tracker changed from Issue to Story
- % Done set to 0
- Severity deleted (
2. Medium) - Triaged deleted (
No)
Updated by daviddavis over 3 years ago
Will updating the setting/field automatically clean up repo versions? Like if I set the value to 3 and I have 5 versions, does that automatically delete 2 versions?
Updated by bmbouter over 3 years ago
- Tags GalaxyNG added
daviddavis wrote:
Will updating the setting/field automatically clean up repo versions? Like if I set the value to 3 and I have 5 versions, does that automatically delete 2 versions?
My take was no, but it's important we figure out what we want in the long term because it affects if we have to use the tasking system or not for any change to this. The openapi schema already reports that tasking isn't used, so I'm thinking that maybe we can't have some repsonses return 200 and others returned 202? I'm not clear on if that's a problem for openapi or not. Do you know?
Updated by daviddavis over 3 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
Updated by pulpbot over 3 years ago
- Status changed from ASSIGNED to POST
Updated by daviddavis over 3 years ago
bmbouter wrote:
My take was no, but it's important we figure out what we want in the long term because it affects if we have to use the tasking system or not for any change to this. The openapi schema already reports that tasking isn't used, so I'm thinking that maybe we can't have some repsonses return 200 and others returned 202? I'm not clear on if that's a problem for openapi or not. Do you know?
Sorry, I only saw this comment after I opened my PR. The calls to update repository are in fact async:
https://docs.pulpproject.org/pulp_file/restapi.html#operation/repositories_file_file_update
https://docs.pulpproject.org/pulp_file/restapi.html#operation/repositories_file_file_partial_update
I don't know if that makes an argument for supporting cleanup during update but I don't have a huge preference around whether we cleanup versions.
Updated by daviddavis over 3 years ago
- Blocked by Story #8454: As a user, I can't delete RepositoryVersion.number==0 added
Updated by mdellweg over 3 years ago
- Sprint/Milestone changed from 3.12.0 to 3.13.0
Added by daviddavis over 3 years ago
Updated by daviddavis over 3 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulpcore|0779b5d163d2a11830951157a4e10918f4d65c38.
Updated by daviddavis over 3 years ago
- Related to Issue #8793: Retained_versions doesn't properly keep all content present in repository added
Updated by pulpbot over 3 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Updated by ipanova@redhat.com over 3 years ago
- Sprint/Milestone changed from 3.13.0 to Content/disk space management
Updated by ipanova@redhat.com over 3 years ago
- Sprint/Milestone changed from Content/disk space management to 3.13.0
Limit how many repo versions Pulp retains
fixes #8368