Project

Profile

Help

Story #8368

Limit number of old repository versions.

Added by newswangerd 3 months ago. Updated 10 days ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
GalaxyNG
Sprint:
Quarter:

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 repo rejected should keep the last 5 repo versions

Related issues

Related to Pulp - Issue #8793: Retained_versions doesn't properly keep all content present in repositoryCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocked by Pulp - Story #8454: As a user, I can't delete RepositoryVersion.number==0CLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 0779b5d1 View on GitHub
Added by daviddavis about 2 months ago

Limit how many repo versions Pulp retains

fixes #8368

History

#1 Updated by mdellweg 3 months 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?

#2 Updated by ttereshc 3 months ago

  • Tracker changed from Issue to Story
  • % Done set to 0
  • Severity deleted (2. Medium)
  • Triaged deleted (No)

#3 Updated by daviddavis 3 months 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?

#4 Updated by bmbouter 3 months 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?

#5 Updated by daviddavis 3 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to daviddavis

#6 Updated by pulpbot 3 months ago

  • Status changed from ASSIGNED to POST

#7 Updated by daviddavis 3 months 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.

#8 Updated by daviddavis 3 months ago

  • Blocked by Story #8454: As a user, I can't delete RepositoryVersion.number==0 added

#9 Updated by bmbouter 3 months ago

  • Sprint/Milestone set to 3.12.0

#10 Updated by mdellweg 2 months ago

  • Sprint/Milestone changed from 3.12.0 to 3.13.0

#11 Updated by daviddavis about 2 months ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#12 Updated by daviddavis 24 days ago

  • Related to Issue #8793: Retained_versions doesn't properly keep all content present in repository added

#13 Updated by pulpbot 19 days ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

#14 Updated by ipanova@redhat.com 10 days ago

  • Sprint/Milestone changed from 3.13.0 to Content/disk space management

Please register to edit this issue

Also available in: Atom PDF